Attribute VB_Name = "modLabel8"
'----------------------------------------------------------------------------------
'Author: Domonic Grande emp# 396671
'Project Contributors: Kevin Martin, Victor Graves, Bruce Acomb and Heath Galbraith
'Date: April 14 2006
'Revised: Oct 26 2006
'Dependancies: Cafe1.AfterShipPackage,AfterShipMent, BeforeShip
'              frm.LabelConfig
'              Windows Registry
'              FdxZebra.dll  (see documentation)
'              Microsoft Scripting Runtime (set in Refs) (needed for FSO)
'Features: Customer Logo, up to 4 ref fields for ground and express,
'          optional barcode format for refs, 300 char message field, customer URL,
'          PickTicket and optional barcoded doc tabs
'
'FedEx Canada Feature:
' From ESP, on 2 refs + message, allow any 2 refs, rather than fixed cust ref and ship id.
' Avoid code for identical packages when Canada origin.
' From Fujitsu, allow no offset (6 inch label) and custom doc tab, i.e. barcode.
' In general, allow for FXI crash and restart to get outstanding labels.
'
'**********************************************************************************
'CAUTION:
'THIS CODE SHOULD NOT BE CHANGED.  IT IS DESIGNED TO CREATE A CONSISTANT
'LABEL ENVIRONMENT ADDING MANY OF THE MOST REQUESTED FEATURES BY CUSTOMERS.
'BECAUSE THE HELP DESK CAN'T SEE THE LABEL TO TROUBLESHOOT, THE CODE THAT CREATES
'THE LABEL (SUBS (EplDocTabNO, EplDocTabYes, ZplDocTabNo, ZplDocTabYes)) SHOULD
'NOT BE CHANGED.  THE FEATUERS ADDED ARE APPROVED BY CLS.  ANY OTHER CHANGES TO THE
'LABEL WILL REQUIRE LABEL APPROVAL AND WILL BE CONSIDERED A 'CUSTOM LABEL'.  IF
'ANY CHANGES ARE MADE, THE CIC WILL BE THE ONLY SOURCE OF SUPPORT FOR THE CUSTOMER.
'**********************************************************************************
'
'
'Oct 13 2006:
'            ZPL printer support added (usb and com/par)
'Oct 26 2006:
'            Added PickTicket for both printers
'May 5 2007:
'            Added UCC128 (SSCC18) Barcode feature
'            Added Sort ID feature
'            Added word wrap for all printers
'            Fixed Dept Notes mismap for dot proc
'
'            Notes on UCC128:
'                            UCC128 / SSCC18 barcode is printed when the feature is
'                            selected on the config form and the COMPLETE UCC128
'                            barcode number is passed via the afterShip event.
'                            This code does not maintain the license plate,
'                            nor does it calculate the check diget.  It simply
'                            creates an appropriate barcode and the human readable
'                            number.  If a customer desires either of these things,
'                            they can be provided earlier in your code and the
'                            complete number passed in the afterShip event.
'
'Nov 14 2007:
'            Added Bed Bath & Beyond Vendor label
'
'            Notes:
'                  A public instance of the User Defined Type(udt) BedBathBeyond
'                 (m_udtBedBathBeyond) should be populated when recip data is
'                  gathered.  This data can also be gathered from screen in the
'                  BeforeShipPackage Event if the system is stand alone.  By
'                  populating this udt and selecting "Bed Bath & Beyond" from
'                  the FeatureSet combo box on the frmLableConfig the vendor info
'                  will print on the top 2 inches of an 8 inch label.  It is
'                  important to note that the 4 data elements in the udt must be
'                  complete and formatted according to Bed Bath & Beyond specs.
'                  This project ONLY addresses the printing of the label.  It does
'                  NOT put the Bed Bath & Beyond data in the correct ref fields.
'
' 2008-09-17, JFW, Barcode tracking number in the doctab for Meena
'
' 2009-04-30, JFW, CA domestic Ground signature required.
'
' 2010-08-09, JFW, Reference to ZebraPrinter made object to ease installation.
'
'----------------------------------------------------------------------------------
       
Option Explicit

' 2010-12-13, JFW, First label long delay, and quick delay after
Dim m_lngFirstLabelDelay As Long

'------------------------------------------------------------------------------
'This is a Public user defined Type.  It should be used in a script's
'query routine.  A Public instance is below (PickTicket).  The user should
'populate the variables in this Type from customer data.  This type consists of
'5 ref fields (with configurable captions), 4 column headers,10 rows with 4
'fields each (Row01Col1) and 3 footer fields (with configurable captions)
'------------------------------------------------------------------------------
Public Type PickTicketValues
    '-----------------------
    'Ref Fields with BatchID
    '-----------------------
    BatchId As String
    PicRef1 As String
    PicRef2 As String
    PicRef3 As String
    PicRef4 As String
    '--------
    'Captions
    '--------
    BatchIdCap As String
    PicRef1Cap As String
    PicRef2Cap As String
    PicRef3Cap As String
    PicRef4Cap As String
    '--------------
    'Column headers
    '--------------
    ColHeader1 As String
    ColHeader2 As String
    ColHeader3 As String
    ColHeader4 As String
    '-------
    'Footers
    '-------
    TicketFooter1 As String
    TicketFooter2 As String
    TicketFooter3 As String
    '---------------
    'Footer captions
    '---------------
    TicketFooter1Cap As String
    TicketFooter2Cap As String
    TicketFooter3Cap As String
    '---------------
    'Row1 column 1-4
    '---------------
    Row01Col1 As String
    Row01Col2 As String
    Row01Col3 As String
    Row01Col4 As String
    '---------------
    'Row2 column 1-4
    '---------------
    Row02Col1 As String
    Row02Col2 As String
    Row02Col3 As String
    Row02Col4 As String
    '---------------
    'Row3 column 1-4
    '---------------
    Row03Col1 As String
    Row03Col2 As String
    Row03Col3 As String
    Row03Col4 As String
    '---------------
    'Row4 column 1-4
    '---------------
    Row04Col1 As String
    Row04Col2 As String
    Row04Col3 As String
    Row04Col4 As String
    '---------------
    'Row5 column 1-4
    '---------------
    Row05Col1 As String
    Row05Col2 As String
    Row05Col3 As String
    Row05Col4 As String
    '---------------
    'Row6 column 1-4
    '---------------
    Row06Col1 As String
    Row06Col2 As String
    Row06Col3 As String
    Row06Col4 As String
    '---------------
    'Row7 column 1-4
    '---------------
    Row07Col1 As String
    Row07Col2 As String
    Row07Col3 As String
    Row07Col4 As String
    '---------------
    'Row8 column 1-4
    '---------------
    Row08Col1 As String
    Row08Col2 As String
    Row08Col3 As String
    Row08Col4 As String
    '---------------
    'Row9 column 1-4
    '---------------
    Row09Col1 As String
    Row09Col2 As String
    Row09Col3 As String
    Row09Col4 As String
    '----------------
    'Row10 column 1-4
    '----------------
    Row10Col1 As String
    Row10Col2 As String
    Row10Col3 As String
    Row10Col4 As String

End Type

'-----------------------------------------------------------------------
'This udt should be populated (where customer data is gathered) to print
'Bed Bath & Beyond data on label
'-----------------------------------------------------------------------
Type BedBathBeyond
    SSCC18 As String
    StoreNumber As String
    PoNumber As String
    VendorNumber As String
End Type


Public m_udtBedBathBeyond As BedBathBeyond      'Public instance of User Defined Type (Bed Bath & Beyond)
Public m_udtPickTicket As PickTicketValues      'Public instance of User Defined Type (PickTicketValues)
Dim m_strLabelFeatureSet As String              'Use PickTicket yes/no
Dim m_strSortIdFontSize As String               'Font size for sort id feature
Dim m_strLabelStock As String                   '8" or 8" with 1" doc
Dim m_strLogo As String                         'Customer wants logo yes or no
Dim m_strRefOptions As String                   '4 refs, 2 refs and message, message only
Dim m_strRefFormat As String                    'readable, barcode or both
Dim m_strPrinterType As String                  'EPL or ZPL Printer
Dim m_strDocTabInfo As String                   'standard, 1 bcode or 2 bcodes on doc
Dim m_strURL As String                          'Customer's URL
Dim m_strRef1 As String                         'cr (3003)
Dim m_strRef2 As String                         'po (3001)
Dim m_strRef3 As String                         'inv (3002)
Dim m_strRef4 As String                         'dept (2006)
Dim m_strRef1Cap As String                      'cr caption
Dim m_strRef2Cap As String                      'po caption
Dim m_strRef3Cap As String                      'inv caption
Dim m_strRef4Cap As String                      'dept caption
Dim m_strDocRef1 As String                      'cr (docTab)
Dim m_strDocRef2 As String                      'tracking number
Dim m_strDocRef1Cap As String                   'cr caption
Dim m_strDocRef2Cap As String                   'tracking number caption
Dim m_strMessageCaption As String               'message caption
Dim m_strMessage As String                      'holds message passed in via code
Dim m_strSSCC18 As String                       'holds sscc18 number passed in via code
Dim m_strSortID As String                       'holds SortID passed in via code
Dim m_strLabelTempFolder As String              'location where labels are sent before printed
Dim m_strBufferFile As String                   'temp file where labels are built before print
Dim m_lngBufferFile As Long
Dim m_strTrackingNumber As String               'holds tracking number

' 2011-11-29, JFW, hold MPS tracking numbers
Dim m_colTrackingNumber As Collection

Dim m_strLineItem As String                     'each line in the label buffer being looped through
Dim m_strBuildNewLabel As String                'string holds new label as being built
Dim m_blnPrintFromAfterShipment As Boolean      'flag telling to print from aftership or aftershipment
Dim m_strIDMps As String                        'mps flag
Dim m_blnDotProcess As Boolean                  'set by calling code to tell if dot proc or not
Dim m_blnBatchProc As Boolean                   'set by calling code to tell if batch proc or not
Dim m_strCodFlag As String                      'cod flag
Dim m_strIdMpsTrack As String                   'grabs track number from label buffer if id mps
Dim m_strDate As String                         'Used to look at label file names
Dim m_strLabel As String                        'Holds original label before modified
Dim m_strUNC As String                          'unc to print to
Dim m_strRunDir As String                       'This tell what folder cafe is installed (hardware or SWO)
Dim m_strPrinterName As String                  'Printer name passed to FdxZebra.dll to flash graphic to printer
' 2009-07-21, JFW
Dim m_boolTDMPS As Boolean                      'Change label number
Public m_lngTDMPSTotalCount As Long
Public m_lngTDMPSPieceCount As Long
Public m_boolTDMPSToggle As Boolean
' 2011-02-16, JFW
Dim m_boolRemoveAWB As Boolean                  'Remove customer AWB from intl labels
Dim m_boolRemoveExtraLabels As Boolean          'Remove Saturday (and First) labels
' 2011-01-01, JFW, Enhanced reference for Shoppers Drug Mart
Public m_boolEnhanceReferences As Boolean
' FedEx Canada
Const EIGHTINCHOFFSET_DOCTAB As Long = 465              ' Set to 0 for 6 inch label custom doc tab
Const EIGHTINCHOFFSET_NODOCTAB As Long = 265
Dim strSenderCountry As String                          ' Canada always processes labels AfterShipment
'
        
   
Public Sub PrinterTest()
'---------------------------------------------------------------------
'Author: Domonic Grande emp# 396671
'Date: April 14 2006
'Revised: Oct 13 2006
'Desc:
'      This sub prints out a doc tab and tells what is stored
'      in the printer's memory and a test of the image stored
'Oct 13 2006:
'           Added ZPL support, changed method of flashing printer from
'           direct com write to win32 API (FdxZebra.dll)
'---------------------------------------------------------------------
    
    
   On Error GoTo EH
    
    '----------------------------------
    'Gets all settins stored in the reg
    '----------------------------------
    modLabel8.GetSettings
    '-------------------------------------
    'Print what is stored in printer's mem
    '-------------------------------------
    Dim strEltronCommand_GI As String
    '----------------------------------------------
    'Print image on label (not in correct position)
    '----------------------------------------------
    Dim strEltronCommand_GG As String
    '----------------------------------------------------------------------------------------------------
    'This inst allows use of a method in FdxZebra.dll.  This dll uses the win32 API to send data directly
    'to USB (or any) ports.  'PrinterExecute' method will return '0' if all is well.  Will return error
    'raised if dll encounters an error.
    '----------------------------------------------------------------------------------------------------
    Dim objZebra As Object
    Set objZebra = CreateObject("ZebraPrinter")
    '----------------------------------------------------------------------------
    'This will hold the return of 'printerExecute' (a method from the above inst)
    'PrinterExecute' method will return '0' if all is well.  Will return error
    'raised if dll encounters an error.
    '----------------------------------------------------------------------------
    Dim strZebraDllReturn As String
    '------------------------------------
    'Hide form and pop up a status splash
    '------------------------------------
    frmLabelConfig.Hide
    
        With StatusWindow
            .Alignment = fsiAlignCenter
            .BackColor = vbWhite
            .TopMost = fsiTopMost
            .Text = "Testing printer... Please wait" & vbCrLf & "Logo printing in test position"
            .Show
        End With
    
    Breathe

    '-------------------------------------------------------------------------------
    'config form sets val in Reg.  Look to see if EPL or ZPL to build correct syntax
    '-------------------------------------------------------------------------------
    If m_strPrinterType = "0" Then
        '------------------------------------
        'Prints what is stored in printer mem
        '------------------------------------
        strEltronCommand_GI = "GI"
        '----------------------------------
        'Prints test logo @ middle of label
        '----------------------------------
        strEltronCommand_GG = "N" & vbCrLf & "GG250,365," & Chr(34) & "LOGO1" & Chr(34) & vbCrLf & "P1" & vbCrLf & "N"
        '------------------------------------------------------------------------------------
        'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
        '------------------------------------------------------------------------------------
        strZebraDllReturn = objZebra.PrinterExecute(strEltronCommand_GI, m_strPrinterName)
        Windows.Sleep (3000)
        '------------------------------------------------------------------------------------
        'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
        '------------------------------------------------------------------------------------
        strZebraDllReturn = objZebra.PrinterExecute(strEltronCommand_GG, m_strPrinterName)
        Windows.Sleep (3000)
    Else
        '----------------------------------------------------------------------
        'Print directory label.  This Tells what is stored in the printer's mem
        '----------------------------------------------------------------------
        Dim strZplCommand_WD As String
        '------------------------------------------------------------------------------------
        'Recall Graphic.  This prints a sample of the logo (in about the middle of the label)
        '------------------------------------------------------------------------------------
        Dim strZplCommand_XG As String
        '------------------------------------------------------------------------------------
        'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
        '------------------------------------------------------------------------------------
        strZplCommand_WD = vbCrLf & "^XA" & vbCrLf & "^WDE:" & vbCrLf & "^XZ" & vbCrLf
        strZebraDllReturn = objZebra.PrinterExecute(strZplCommand_WD, m_strPrinterName)
        Windows.Sleep (5000)
        '------------------------------------------------------------------------------------
        'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
        '------------------------------------------------------------------------------------
        strZplCommand_XG = vbCrLf & "^XA^FO100,100^XGE:LOGO1.PCX,1,1^FS^XZ" & vbCrLf
        '------------------------------------------------------------------------------------
        'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
        '------------------------------------------------------------------------------------
        strZebraDllReturn = objZebra.PrinterExecute(strZplCommand_XG, m_strPrinterName)
        Windows.Sleep (5000)
    End If
    '--------------------------------------------------------------
    'Check the return from the dll.  If <> 0 then message box error
    '--------------------------------------------------------------
    If Trim(strZebraDllReturn) <> "0" Then
        MsgBox strZebraDllReturn, vbExclamation Or vbSystemModal, "FdxZebra.dll Error"
    End If
            
Release:
    '-----------------------------------------------
    'Hide splash, show form and clear the zebra inst
    '-----------------------------------------------
    StatusWindow.Hide
    Set objZebra = Nothing
    frmLabelConfig.Show
    Exit Sub
  
EH:
    MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical Or vbSystemModal, "modLabel8.PrinterTest"
    Resume Release
End Sub

Public Sub PrinterFlash()
'-------------------------------------------------------------------
'Author: Domonic Grande emp# 396671
'Date: April 14 2006
'Desc:
'      This sub flashes the customer's logo graphic to the printer's
'      memory then prints a test label
'Usage:
'      Customer Logo file must be placed in C:\LabelTemp\Logo and be
'      named 'Logo1.pcx'.  This file should be:
'      2 color (black and white), fit in a 1.75 x 1.75 space
'      max 203 dpi, pcx format (best practice to create in bmp mode)
'Revised: Oct 13 2006
'        Added ZPL support, changed method of flashing printer from
'        direct com write to win32 API (FdxZebra.dll)
'-------------------------------------------------------------------
    
On Error GoTo EH
    '------------------------------------------------------
    'vars used to determine image file size in bytes and kb
    '------------------------------------------------------
    Dim intFileLenBytes As Long
    Dim dblFileChk As Double
    Dim intFileLenKb As Long
    '-------------------------
    'Grabs next available file
    '-------------------------
    Dim intNextFileHndl As Integer
    '------------------------------------
    'Used to store eltron commands in str
    '------------------------------------
    Dim strEltronCommand_GM As String
    Dim strEltronCommand_GK As String
    Dim strEltronCommand_M As String
    Dim strEltronCommand_E As String
    Dim strEltronCommand_GI As String
    Dim strEltronCommand_GG As String
    '--------------------------
    'Used to write a batch file
    '--------------------------
    Dim strBatchFile As String
        
    Dim strPathToImage As String
    strPathToImage = "C:\LabelTemp\Logo"
    
    Dim strImageFile As String
    strImageFile = "Logo1.pcx"
        
    '-------------------------------------
    'Gets all stored settings from the reg
    '-------------------------------------
    modLabel8.GetSettings
    '--------------------------------------
    'Look for image file.  If no file, stop
    '--------------------------------------
    If Dir(strPathToImage & "\" & strImageFile) <> "" Then
        '------------------------
        'Image file size in bytes
        '------------------------
        intFileLenBytes = CLng(FileLen(strPathToImage & "\" & strImageFile))
        '-------------------------
        'divide by 1024 to get dec
        '-------------------------
        dblFileChk = (intFileLenBytes / 1024)
        '----------------------------------
        'Convert in int to get whole number
        '----------------------------------
        intFileLenKb = CLng(dblFileChk)
            '-----------------------------
            'if dec not "00" then round up
            '-----------------------------
            If dblFileChk > intFileLenKb Then
               intFileLenKb = intFileLenKb + 1
            Else
                '
            End If
            
            '------------------------------------
            'Read pcx file into a string (binary)
            '------------------------------------
            Dim strImageAsBinary As String
            Open "c:\labeltemp\logo\logo1.pcx" For Binary As #1
                strImageAsBinary = Input$(LOF(1), #1)
            Close #1
            '----------------------------------------------------------------------------------------------------
            'This inst allows use of a method in FdxZebra.dll.  This dll uses the win32 API to send data directly
            'to USB (or any) ports.  'PrinterExecute' method will return '0' if all is well.  Will return error
            'raised if dll encounters an error.
            '----------------------------------------------------------------------------------------------------
            Dim objZebra As Object
            Set objZebra = CreateObject("ZebraPrinter")
            '----------------------------------------------------------------------------
            'This will hold the return of 'printerExecute' (a method from the above inst)
            'PrinterExecute' method will return '0' if all is well.  Will return error
            'raised if dll encounters an error.
            '----------------------------------------------------------------------------
            Dim strZebraDllReturn As String
            '------------------------------------
            'Hide form and pop up a status splash
            '------------------------------------
            frmLabelConfig.Hide
                
                With StatusWindow
                    .Alignment = fsiAlignCenter
                    .BackColor = vbWhite
                    .TopMost = fsiTopMost
                    .Text = "Storing graphic in printer... Please wait" & vbCrLf & "Logo printing in test position"
                    .Show
                End With
            
            Breathe
            '-------------------------------------------------------------------------------
            'config form sets val in Reg.  Look to see if EPL or ZPL to build correct syntax
            '-------------------------------------------------------------------------------
            If m_strPrinterType = "0" Then
                '------------------------------------
                'Store graphic in printer mem (bytes)
                '------------------------------------
                strEltronCommand_GM = "GM" & Chr(34) & "LOGO1" & Chr(34) & intFileLenBytes & vbCrLf & strImageAsBinary & vbCrLf
                '----------------------------------------------
                'Delete graphic by stored name from printer mem
                '----------------------------------------------
                strEltronCommand_GK = "GK" & Chr(34) & "LOGO1" & Chr(34)
                '------------------------------------
                'Prints what is stored in printer mem
                '------------------------------------
                strEltronCommand_GI = "GI"
                '----------------------------------
                'Prints test logo @ middle of label
                '----------------------------------
                strEltronCommand_GG = "N" & vbCrLf & "GG250,365," & Chr(34) & "LOGO1" & Chr(34) & vbCrLf & "P1" & vbCrLf & "N"
                '------------------------------------------------------------------------------------
                'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
                '------------------------------------------------------------------------------------
                strZebraDllReturn = objZebra.PrinterExecute(strEltronCommand_GK, m_strPrinterName)
                Windows.Sleep (5000)
                '------------------------------------------------
                'Per zebra, send delete command twice (fail safe)
                '------------------------------------------------
                strZebraDllReturn = objZebra.PrinterExecute(strEltronCommand_GK, m_strPrinterName)
                Windows.Sleep (5000)
                '------------------------------------------------------------------------------------
                'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
                '------------------------------------------------------------------------------------
                strZebraDllReturn = objZebra.PrinterExecute(vbCrLf & strEltronCommand_GM, m_strPrinterName)
                Windows.Sleep (3000)
                '------------------------------------------------------------------------------------
                'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
                '------------------------------------------------------------------------------------
                strZebraDllReturn = objZebra.PrinterExecute(strEltronCommand_GI, m_strPrinterName)
                Windows.Sleep (3000)
                '------------------------------------------------------------------------------------
                'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
                '------------------------------------------------------------------------------------
                strZebraDllReturn = objZebra.PrinterExecute(strEltronCommand_GG, m_strPrinterName)
                Windows.Sleep (3000)
                
            Else
                '------------------------------------------
                'Download Graphic.  Send Graphic to printer
                '------------------------------------------
                Dim strZplCommand_DY As String
                '----------------------------------------------------------------------
                'Print directory label.  This Tells what is stored in the printer's mem
                '----------------------------------------------------------------------
                Dim strZplCommand_WD As String
                '----------------------------------------------
                'Object Delete.  Used to Delete Graphic by name
                '----------------------------------------------
                Dim strZplCommand_ID As String
                '------------------------------------------------------------------------------------
                'Recall Graphic.  This prints a sample of the logo (in about the middle of the label)
                '------------------------------------------------------------------------------------
                Dim strZplCommand_XG As String
                
                
                '------
                'Delete
                '------
                strZplCommand_ID = vbCrLf & "^XA" & vbCrLf & "^IDE:LOGO1.PCX" & vbCrLf & "^XZ" & vbCrLf
                '------------------------------------------------------------------------------------
                'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
                '------------------------------------------------------------------------------------
                strZebraDllReturn = objZebra.PrinterExecute(strZplCommand_ID, m_strPrinterName)
                Windows.Sleep (5000)
                '-----
                'Store
                '-----
                strZplCommand_DY = vbCrLf & "~DYE:LOGO1.PCX,b,X," & intFileLenBytes & ",," & strImageAsBinary & vbCrLf
                '------------------------------------------------------------------------------------
                'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
                '------------------------------------------------------------------------------------
                strZebraDllReturn = objZebra.PrinterExecute(strZplCommand_DY, m_strPrinterName)
                Windows.Sleep (5000)
                '---------
                'Print Dir
                '---------
                strZplCommand_WD = vbCrLf & "^XA" & vbCrLf & "^WDE:" & vbCrLf & "^XZ" & vbCrLf
                '------------------------------------------------------------------------------------
                'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
                '------------------------------------------------------------------------------------
                strZebraDllReturn = objZebra.PrinterExecute(strZplCommand_WD, m_strPrinterName)
                Windows.Sleep (5000)
                '--------------
                'Recall (print)
                '--------------
                strZplCommand_XG = vbCrLf & "^XA^FO100,100^XGE:LOGO1.PCX,1,1^FS^XZ" & vbCrLf
                '------------------------------------------------------------------------------------
                'See dec above for specs.  This passes print command and printer name to FdxZebra.dll
                '------------------------------------------------------------------------------------
                strZebraDllReturn = objZebra.PrinterExecute(strZplCommand_XG, m_strPrinterName)
                Windows.Sleep (5000)
            End If
                
    Else
        MsgBox "Image file not found", vbInformation Or vbSystemModal, "Error"
        Exit Sub
    End If
    
    '--------------------------------------------------------------
    'Check the return from the dll.  If <> 0 then message box error
    '--------------------------------------------------------------
    If Trim(strZebraDllReturn) <> "0" Then
        MsgBox strZebraDllReturn, vbExclamation Or vbSystemModal, "FdxZebra.dll Error"
    End If
    
Release:
    StatusWindow.Hide
    Set objZebra = Nothing
    frmLabelConfig.Show
    Exit Sub
EH:
    MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical Or vbSystemModal, "modLabel8.PrinterFlash"
    Resume Release
End Sub


Public Function EightInchOffset() As Long

    If m_strLabelFeatureSet <> "6" Then
        If m_strLabelStock = "0" Then
            '------
            'No Doc
            '------
            EightInchOffset = EIGHTINCHOFFSET_NODOCTAB
        Else
            '---
            'Doc
            '---
            EightInchOffset = EIGHTINCHOFFSET_DOCTAB
        End If
    Else
        ' Six inch label
        EightInchOffset = 0
    End If
    
End Function


Public Sub GetSettings()
'--------------------------------------------------------------------------------
'Author: Domonic Grande emp# 396671
'Called From: modLabel8.GetVals, modLabel8.FlashPrinter and modLabel8.TestPrinter
'Desc: Gathers various settings from with windows registry.  Settings created by
'      frmLabelConfig
'--------------------------------------------------------------------------------
    On Error GoTo EH
    
    Dim objFSO As FileSystemObject
    Set objFSO = New FileSystemObject
    
    '-----------------------------------------------------------------------------------
    'Labels will be dropped in ship_nt\bin.  Look for ship_nt on root (hardware install)
    'else, look in program files (swo)
    '-----------------------------------------------------------------------------------
    With objFSO
        If .FolderExists("C:\Documents and Settings\All Users\Application Data\FedEx\FSM\Temp\LabelBuffers") Then
            m_strRunDir = "C:\Documents and Settings\All Users\Application Data\FedEx\FSM\Temp\LabelBuffers\"
        ElseIf .FolderExists("C:\Program Files\FedEx\ShipManager\Bin") Then
            m_strRunDir = "C:\Program Files\FedEx\ShipManager\Bin\"
        ElseIf .FolderExists("C:\Ship_nt\Bin") Then
            m_strRunDir = "C:\Ship_nt\Bin\"
        Else
            m_strRunDir = "C:\Program Files\FedEx\ShipManager\Bin\"
        End If
        '------------------------------------------
        'If LabelTemp folder not present, create it
        '------------------------------------------
        If Not .FolderExists("C:\LabelTemp") Then
            .CreateFolder ("C:\LabelTemp")
            .CreateFolder ("C:\LabelTemp\Logo")
        End If
    End With
    
    '-------------------------------------
    'Set temp path and file name for label
    '-------------------------------------
    m_strLabelTempFolder = "C:\LabelTemp\"
    m_strBufferFile = "Label.txt"


'-------------------------------------------------------------------
'Called from below in this sub if needed.  Just reloads reg settings
'-------------------------------------------------------------------
RecallGetSettings:
    '--------------------------------------
    'get vals from reg and set m_level vars
    '--------------------------------------
     m_strSortIdFontSize = Registry.GetValue(fsiDefault, "CustomLabelKey", "LabelSortIdFontSizeValue")
     m_strLabelFeatureSet = Trim(Registry.GetValue(fsiDefault, "CustomLabelKey", "LabelFeatureSetValue"))
     m_strLabelStock = Registry.GetValue(fsiDefault, "CustomLabelKey", "LabelStockValue")
     m_strPrinterType = Registry.GetValue(fsiDefault, "CustomLabelKey", "PrinterTypeValue")
     m_strPrinterName = Registry.GetValue(fsiDefault, "CustomLabelKey", "PrinterNameValue")
     m_strLogo = Registry.GetValue(fsiDefault, "CustomLabelKey", "LogoValue")
     m_strRefOptions = Registry.GetValue(fsiDefault, "CustomLabelKey", "RefOptionsValue")
     m_strRefFormat = Registry.GetValue(fsiDefault, "CustomLabelKey", "RefFormatValue")
     m_strDocTabInfo = Registry.GetValue(fsiDefault, "CustomLabelKey", "DocTabInfoValue")
     m_strURL = Registry.GetValue(fsiDefault, "CustomLabelKey", "UrlValue")
     m_strUNC = Trim(Registry.GetValue(fsiDefault, "CustomLabelKey", "UncValue"))
     m_strRef1Cap = Registry.GetValue(fsiDefault, "CustomLabelKey", "RefCaption1Value")
     m_strRef2Cap = Registry.GetValue(fsiDefault, "CustomLabelKey", "RefCaption2Value")
     m_strRef3Cap = Registry.GetValue(fsiDefault, "CustomLabelKey", "RefCaption3Value")
     m_strRef4Cap = Registry.GetValue(fsiDefault, "CustomLabelKey", "RefCaption4Value")
     m_strMessageCaption = Registry.GetValue(fsiDefault, "CustomLabelKey", "MessageValue")
     m_strDocRef1Cap = Registry.GetValue(fsiDefault, "CustomLabelKey", "DocRefCaption1Value")
     m_strDocRef2Cap = Registry.GetValue(fsiDefault, "CustomLabelKey", "DocRefCaption2Value")
     m_boolTDMPS = CBool(Registry.GetValue(fsiDefault, "CustomLabelKey", "TDMPSValue"))
     m_boolRemoveAWB = CBool(Registry.GetValue(fsiDefault, "CustomLabelKey", "RemoveAWB"))
     m_boolRemoveExtraLabels = CBool(Registry.GetValue(fsiDefault, "CustomLabelKey", "RemoveExtraLabels"))
    
     '----------------------------------------------------
     'If minimums on form are not filled out, display form
     '----------------------------------------------------
     Dim blnShowForm As Boolean
     blnShowForm = False
     
     If Trim(m_strLabelStock) = "" Then
        blnShowForm = True
     End If
     
     If Trim(m_strPrinterType) = "" Then
        blnShowForm = True
     End If
     
     If Trim(m_strUNC) = "" Then
        blnShowForm = True
     End If
     
     If m_strLabelFeatureSet = "" Then
        blnShowForm = True
     End If
     
     If Trim(m_strLogo) = "" Then
        blnShowForm = True
     End If
     
     If Trim(m_strRefOptions) = "" Then
        blnShowForm = True
     End If
     '---------------------------
     'Show form if not filled out
     '---------------------------
     If blnShowForm Then
        frmLabelConfig.Show
        '----------------------------------------------------------
        'This goto is going to the above registry reads in THIS SUB
        '----------------------------------------------------------
        GoTo RecallGetSettings
     End If
    
    ' 2011-01-06, JFW, Canadian origin is always print after shipment
    If Cafe1.Screen.GetSender.Country = "CA" Then
        m_blnPrintFromAfterShipment = True
    End If
    
Release:
    Set objFSO = Nothing
    Exit Sub

EH:
    MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical Or vbSystemModal, "modLabel8.GetSettings"
    Resume Release
End Sub

Public Sub GetVals(Optional ByVal TrackingNumber As String, _
                        Optional ByVal Meter As String, _
                        Optional ByVal IsInternational As Boolean, _
                        Optional ByVal objPackage As FSM.Package, _
                        Optional ByVal blnDotProcess As Boolean, _
                        Optional ByVal strMessage As String, _
                        Optional ByVal strSSCC18 As String, _
                        Optional ByVal strSortID As String, _
                        Optional ByVal blnBatchProc As Boolean)

'------------------------------------------------------------------------
'Author: Domonic Grande emp# 396671
'Called from: Cafe1.AfterShipPackage
'Desc: This sub gathers data from cafe either using a table return of the
'      package object and reads it into module level vars.  Once done it
'      determines if shipment is .proc or f10 etc and call correct code.
'------------------------------------------------------------------------
        
        
    On Error GoTo EH:
    '------------------------------------------
    'Assign vals passed into function to m_Vals
    '------------------------------------------
    m_blnDotProcess = blnDotProcess
    m_blnBatchProc = blnBatchProc
    m_strMessage = strMessage
    m_strSSCC18 = strSSCC18
    m_strSortID = strSortID
    '------------------------------------
    'Gets settings from reg (set by form)
    '------------------------------------
    modLabel8.GetSettings
    '----------------------------------------
    'If not dot proc, get data from tblReturn
    '----------------------------------------
    If m_blnDotProcess = False Then
        '--------------------------------
        'Holds data coming back from cafe
        '--------------------------------
        Dim tblReturn As FSM.Table
        '--------------------------------
        'Holds field id's being looked up
        '--------------------------------
        Dim strLookUpFields As String
        Dim strShipDate As String
        
        If TrackingNumber <> "" Then
            '----------------------
            'cr,po,inv,dept,cod_flg
            '----------------------
            strLookUpFields = "3003,3001,3002,2006,27,117"
            '------------------------
            'Looks up data in cafe db
            '------------------------
            Set tblReturn = Cafe1.Databases.Shipment(strLookUpFields, Meter, IsInternational).Lookup(TrackingNumber)
            If tblReturn.Records.Count > 0 Then
                '---------
                'cr (3003)
                '---------
                m_strRef1 = tblReturn.Records(0).Fields(0).Value
                '---------
                'po (3001)
                '---------
                m_strRef2 = tblReturn.Records(0).Fields(1).Value
                '----------
                'inv (3002)
                '----------
                m_strRef3 = tblReturn.Records(0).Fields(2).Value
                '-----------
                'dept (2006)
                '-----------
                m_strRef4 = tblReturn.Records(0).Fields(3).Value
                '------------
                'cod_flg (27)
                '------------
                m_strCodFlag = tblReturn.Records(0).Fields(4).Value
                '
                strSenderCountry = tblReturn.Records(0).Fields("117").Value
            End If ' Records
        End If ' TrackingNumber
        
        ' Logfile "GetVals", "Set tracking number " & TrackingNumber
        '--------------------
        'tracking number (29)
        '--------------------
        m_strTrackingNumber = TrackingNumber
        
        '-----------------------------------------------------------------
        'Changed because name of text file does not have the ship date but
        'rather the creation date
        '-----------------------------------------------------------------
        m_strDate = Format(Date$, "MMDDYYYY")
        
        '--------------------------------------------
        'If cod, id_mps or int... Print from
        'AfterShipMent event.  Else, aftershippackage
        '--------------------------------------------
        If UCase(m_strCodFlag) = "Y" Then
            m_blnPrintFromAfterShipment = True
        ElseIf UCase(m_strIDMps) = "Y" Then
            m_blnPrintFromAfterShipment = True
        ElseIf IsInternational = True Then
            m_blnPrintFromAfterShipment = True
        ElseIf strSenderCountry = "CA" Then
            m_blnPrintFromAfterShipment = True
        Else
            If strSenderCountry = "" Then
                strSenderCountry = Cafe1.Screen.GetSender.Country
            End If
            ' 2008-03-03, JFW, CA origin vs. US dom
            If strSenderCountry = "CA" Then
                m_blnPrintFromAfterShipment = True
            Else
                m_blnPrintFromAfterShipment = False
            End If
        End If

        ' Logfile "GetVals", "Calling ProcessSingle 1"
        
        '---------------------------------------------------
        'Calls process to change single package label buffer
        '---------------------------------------------------
        modLabel8.ProcessSingle m_blnDotProcess
    '--------
    'If .proc
    '--------
    Else
        '------------------
        'if non-batch .proc
        '------------------
        If m_blnBatchProc = False Then
            
            If m_strTrackingNumber <> "" Then
                ' Logfile "GetVals", "Warning, tracking number not expected, tracking number " & m_strTrackingNumber
            End If
            
            With objPackage
                m_strTrackingNumber = .TrackNo
                m_strRef1 = .CustomerReference
                m_strRef2 = .PurchaseOrder
                m_strRef3 = .Invoice
                m_strRef4 = .DepartmentNotes
            End With
            
            ' Logfile "GetVals", "Calling ProcessSingle 2"
            
            '---------------------------------------------------
            'Calls process to change single package label buffer
            '---------------------------------------------------
            modLabel8.ProcessSingle m_blnDotProcess
        Else
            
            If m_strTrackingNumber <> "" Then
                MsgBox "Label8.GetVals, Tracking number not expected, " & m_strTrackingNumber, vbApplicationModal + vbSystemModal
            End If
            
            With objPackage
                m_strTrackingNumber = .TrackNo
                m_strRef1 = .CustomerReference
                m_strRef2 = .PurchaseOrder
                m_strRef3 = .Invoice
                m_strRef4 = .DepartmentNotes
            End With
            '--------------------------
            'take out delay if unneeded
            '--------------------------
            Windows.Sleep (1000)
            '----------------
            'Call print batch
            '----------------
            modLabel8.ProcessBatch
            
        End If
    End If
    Exit Sub
EH:
    MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical Or vbSystemModal, "modLabel8.GetVals"
    If False Then
        Resume
    End If

End Sub
'

Public Sub ProcessSingle(Optional ByVal blnDotProcess)
    '------------------------------------------------------------------------
    'Author: Domonic Grande emp# 396671
    'Called from: modLabel8.GetVals or modLabel8.EventAfterShipMent
    'Desc: This sub id's the label buffer in the Ship_nt\Bin folder, opens
    '      it, and calls the correct programming 'track' based upon settings
    '      provided on config form.  Primary setting is printer lang
    '------------------------------------------------------------------------

    ' 2010-11-26, JFW, Next label buffer, get the correct tracking number.
    Dim strLineTrack() As String
    ' 2010-10-14, JFW, Give FSM a bit of time
    Dim i As Long
    
    On Error GoTo EH:
    
    ' Logfile "ProcessSingle", "DotProcess " & blnDotProcess
    ' Logfile "ProcessSingle", "Label, IDMPS " & m_strIDMps
    ' Logfile "ProcessSingle", "Label, DotProcess " & blnDotProcess
    ' Logfile "ProcessSingle", "Label, Tracking number " & m_strTrackingNumber
    
    ' 2010-12-31, JFW
    If m_lngFirstLabelDelay <= 0 Then
        If m_strTrackingNumber <> "" Then
            m_lngFirstLabelDelay = 40000
        Else
            m_lngFirstLabelDelay = 500
        End If
        ' Logfile "ProcessSingle, first label delay " & m_lngFirstLabelDelay & ", tracking number " & m_strTrackingNumber
    Else
        m_lngFirstLabelDelay = 500
    End If
    
    For i = 1 To m_lngFirstLabelDelay
        DoEvents
        '----------------------------------------------------------------------
        'If Identical mps the label file will be identified by looking for
        'the 'date' and 'underscore' in the name of the file.  this will return
        'the full name of the first file in an mps order.
        '----------------------------------------------------------------------
        If m_strIDMps = "Y" Then
            m_strLabel = Dir$(m_strRunDir & m_strDate & "_" & "*" & ".txt", vbNormal)
        ElseIf blnDotProcess And m_strTrackingNumber <> "" Then
            m_strLabel = Dir$(m_strRunDir & "*" & "_" & m_strTrackingNumber & ".txt", vbNormal)
        ElseIf m_strTrackingNumber <> "" Then
            '-----------------------------------------------------------------------------
            'If not identical mps, id the 'date' and 'trackingNumber' from the name of the
            'file.
            '-----------------------------------------------------------------------------
            m_strLabel = Dir$(m_strRunDir & m_strDate & "_" & Trim(m_strTrackingNumber) & ".txt", vbNormal)
            If m_strLabel = "" Then
                m_strLabel = Dir$(m_strRunDir & m_strDate & "_" & Trim(m_strTrackingNumber) & "*.txt", vbNormal)
            End If
        Else
            ' 2011-01-06, JFW, We may be explicitly called for DO NOT SHIP label
            m_strLabel = Dir$(m_strRunDir & "*" & ".txt", vbNormal)
        End If
        If m_strLabel <> "" Then Exit For
    Next i
    
    ' 2010-12-31, JFW
    ' 2011-03-16, JFW, Comment out here
    ' m_lngFirstLabelDelay = 500
    
    If (m_strLabel) <> "" Then
        ' Logfile "ProcessSingle", "File " & m_strLabel
        ' Give FSM a bit more time to finish the label
        For i = 1 To 500
            DoEvents
        Next i
    End If
    
    '------------------------
    'If label buffer is found
    '------------------------
    If (m_strLabel) <> "" Then
      
        Do Until Trim(m_strLabel) = ""
            
            ' Logfile "ProcessSingle", "Open " & m_strLabel
            
            ' Shell "notepad """ & m_strRunDir & m_strLabel & """", vbNormalFocus

            If Windows.ComputerName = "CAN-00325000" Then
                If Not m_boolRemoveAWB Or m_boolRemoveExtraLabels Then
                    With StatusWindow
                        .Alignment = fsiAlignCenter
                        .BackColor = vbWhite
                        .TopMost = fsiTopMost
                        .Text = "Test, RemoveAWB and RemoveExtraLabels."
                        .Show
                        DoEvents
                        .Hide
                    End With
                End If
                m_boolRemoveAWB = True
                m_boolRemoveExtraLabels = True
            End If
            
            If m_boolRemoveAWB Or m_boolRemoveExtraLabels Then
                Open (m_strRunDir & m_strLabel) For Input As #1
                'empty vars
                m_strLineItem = ""
                m_strBuildNewLabel = ""
                'Call sub to move label body and add custom features (by print lang)
                If m_strPrinterType = "0" Then
                      EplRemoveAWB
                Else
                      ZplRemoveAWB
                End If
                Close #1
                '--------------------
                'Delete original file
                '--------------------
                Kill (m_strRunDir & m_strLabel)
        
                '-----------------------------------------------------------
                'Write modified buffer(s) to text file.
                '*Note*  It is important to que multiple label packages
                'before printing.  If not, code will try to grab first label
                'and reprint.
                '-----------------------------------------------------------
                Open m_strRunDir & m_strLabel For Output As #2
                Print #2, m_strBuildNewLabel
                Close #2
            
                ' Shell "notepad """ & m_strRunDir & m_strLabel & """", vbNormalFocus
            
            End If
                 
            '-----------------------
            'Make sure file has data
            '-----------------------
            Open (m_strRunDir & m_strLabel) For Input As #1
            '----------
            'empty vars
            '----------
            m_strLineItem = ""
            m_strBuildNewLabel = ""
            '-------------------------------------------------------------------
            'Call sub to move label body and add custom features (by print lang)
            '-------------------------------------------------------------------
            If m_strPrinterType = "0" Then
                  EplChangeLabel
            Else
                  ZplChangeLabel
            End If
            Close #1
            '--------------------
            'Delete original file
            '--------------------
            Kill (m_strRunDir & m_strLabel)
            '-----------------------------------------------------------
            'Write modified buffer(s) to text file.
            '*Note*  It is important to que multiple label packages
            'before printing.  If not, code will try to grab first label
            'and reprint.
            '-----------------------------------------------------------
            Open m_strLabelTempFolder & m_strBufferFile For Append As #2
            Print #2, m_strBuildNewLabel
            Close #2
            ' Logfile "ProcessSingle", "Close " & m_strLabel
            
            ' Shell "notepad """ & m_strLabelTempFolder & m_strBufferFile & """", vbNormalFocus
                        
            ' 2011-02-18, JFW, On aftershipment, only get the target label, next timer pass to collect other labels.
            If m_strTrackingNumber <> "" Then
                m_strLabel = ""
            Else
                '--------------------------
                'Look for next label buffer
                '--------------------------
                m_strLabel = Dir$(m_strRunDir & m_strDate & "_" & "*" & ".txt")
            
                ' 2010-11-26, JFW, Next label buffer, get the correct tracking number.
                ' Logfile "ProcessSingle", "Next label: " & m_strLabel
                If 0 <> InStr(1, m_strLabel, "_") Then
                    strLineTrack = Split(m_strLabel, "_")
                    For i = LBound(strLineTrack) To UBound(strLineTrack)
                        If Len(strLineTrack(i)) = 12 Then
                            m_strTrackingNumber = strLineTrack(i)
                            ' Logfile "ProcessSingle", "Next tracking number: " & m_strTrackingNumber
                        ElseIf Len(strLineTrack(i)) = 15 Then
                            m_strTrackingNumber = strLineTrack(i)
                            ' Logfile "ProcessSingle", "Next tracking number: " & m_strTrackingNumber
                        End If
                    Next i
                End If
            
            End If
            m_strTrackingNumber = ""
            '~
        Loop
    Else
        Exit Sub
    End If
    
    ' Logfile "ProcessSingle", "Printing"
    
    '---------------------------------------------------------
    'If package is: Int, Cod, Identical MPS or flag is set
    'to print mps labels at end, labels are qued in code above
    'then printed from the after shipMENT event.
    '---------------------------------------------------------
    If m_blnPrintFromAfterShipment = False Then
        PrintLabel
    End If
    '----------------------------
    'If .proc, reset all mod vars
    '----------------------------
    If blnDotProcess = True Then
       modLabel8.ClearModVars
    End If
        
    Exit Sub
    
EH:
    MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
        Or vbSystemModal, "ProcessSingle"
    If False Then
        Resume
    End If
    
End Sub
'


Public Sub PrintLabel()
    
'-----------------------------------------------------------------------
'Author: Domonic Grande emp# 396671
'Called from: modLabel8.ProcessSingle & ProcessBatch
'Desc: This sub uses the file system object to copy the changed label
'      buffer to the thermal printer's unc then deletes the file holding
'      the buffer.
'-----------------------------------------------------------------------

    On Error GoTo EH
    
    Dim objFSO As FileSystemObject
    Set objFSO = New FileSystemObject
        
    If m_strUNC <> "" Then
        With objFSO
            If objFSO.FileExists(m_strLabelTempFolder & m_strBufferFile) Then
                ' Logfile "modLabel8.PrintLabel", "Copy file " & m_strLabelTempFolder & m_strBufferFile
                If UCase(Left(m_strUNC, 3)) = "C:\" Then
                    m_lngBufferFile = m_lngBufferFile + 1
                    .CopyFile m_strLabelTempFolder & m_strBufferFile, m_strUNC & "\Label_" & Format(Now, "HHnnss") & m_lngBufferFile & ".txt"
                Else
                    .CopyFile m_strLabelTempFolder & m_strBufferFile, m_strUNC
                End If
                ' Logfile "modLabel8.PrintLabel", "Delete file " & m_strLabelTempFolder & m_strBufferFile
                .DeleteFile m_strLabelTempFolder & m_strBufferFile
            Else
                ' Logfile "modLabel8.PrintLabel", "No file"
            End If
        End With
    Else
        ' Logfile "modLabel8.PrintLabel", "No output UNC"
    End If
    
Release:
    Set objFSO = Nothing
    Exit Sub
EH:
    MsgBox Err.Description & vbCrLf & Err.Number, vbSystemModal, "modLabel8.PrintLabel"
    Resume Release
    If False Then
        Resume
    End If
End Sub

Public Sub ProcessBatch()
'------------------------------------------------------------------------
'Author: Domonic Grande emp 396671
'Called from: modLabel8.GetVals
'Purpose: This sub id's the label buffer in the Ship_nt\Bin folder, opens
'      it, and calls the correct programming 'track' based upon settings
'      provided on config form.  Primary setting is printer lang
'------------------------------------------------------------------------


On Error GoTo EH:
         '---------------------------------------------
         'ID the label buffer in the Ship_nt\Bin folder
         '---------------------------------------------
         m_strLabel = Dir$(m_strRunDir & "*" & "_" & Trim(m_strTrackingNumber) & ".txt", vbNormal)
                   
         If (m_strLabel) <> "" Then
            '-----------------------
            'Make sure file has data
            '-----------------------
            Open (m_strRunDir & m_strLabel) For Input As #1
            '----------
            'empty vars
            '----------
            m_strLineItem = ""
            m_strBuildNewLabel = ""
            '-------------------------------------------------------------------
            'Call sub to move label body and add custom features (by print lang)
            '-------------------------------------------------------------------
            If m_strPrinterType = "0" Then
                  EplChangeLabel
            Else
                  ZplChangeLabel
            End If
            Close #1
            '--------------------------------------
            'Write modified buffer(s) to text file.
            '--------------------------------------
            Open m_strLabelTempFolder & m_strBufferFile For Append As #2
            Print #2, m_strBuildNewLabel
            Close #2
            '--------------------------------------------------------
            'Prints label, deletes temp file (c:\labeltemp\label.txt)
            '--------------------------------------------------------
            PrintLabel
            '----------------------------------
            'Deletes origin label (Ship_nt\Bin)
            '----------------------------------
            ' Logfile "modLabel8.ProcessBatch", "Kill label file " & m_strRunDir & m_strLabel
            Kill (m_strRunDir & m_strLabel)
        
        Else
            Exit Sub
        End If
    Exit Sub
EH:
    
Resume Next
'--------------------------------------------
'In batch code.  Records that error should be
'recorded and looked at after batch is done
'--------------------------------------------

End Sub


Public Sub EplChangeLabel()
'----------------------------------------------------------------------------
'Author: Domonic Grande emp 396671
'Called from: modLabel8.ProcessSingle or .ProcessBatch
'Purpose: This sub addresses ONLY EPL BUFFERS.  It loops through an opened
'         label buffer (txt file) and moves the FedEx shipping label down
'         about 2" depending on the label stock.  Once room is made, it calls
'         a sub (depending on label stock) to add to the label requested
'         features from frmLabelConfig.
'----------------------------------------------------------------------------
        
       On Error GoTo EH
        
        Dim strNewLineItem As String
        Dim intInstrChk As Integer
        Dim vrtArray As Variant
        Dim intSecondParam As Integer
        Dim intElementCounter As Integer
        Dim intFreeFile As Integer
        
    
        Do
            '---------------------------------------------------
            'Read line from txt file (buffer) into m_strLineItem
            '---------------------------------------------------
            Line Input #1, m_strLineItem
                '---------------------------------------------------
                'If Id mps, grab tracking number from buffer and put
                'in var. Events don't match up to buffer files due
                'to when we get access to buffers.  Pulling trk from
                'buffer puts correct track on barcoded doctabs
                '---------------------------------------------------
                If UCase(m_strIDMps) = "Y" Then
                    '------------------
                    'Target "TRCK:" tag
                    '------------------
                    If InStr(m_strLineItem, Chr(34) & "TRCK:") > 0 Then
                        m_strIdMpsTrack = ""
                        Dim vrtParseTrack As Variant
                        '-----------------------------
                        'Parse line using tag as delim
                        '-----------------------------
                        vrtParseTrack = Split(m_strLineItem, "TRCK:")
                        m_strIdMpsTrack = Trim(vrtParseTrack(1))
                        m_strIdMpsTrack = Left(m_strIdMpsTrack, Len(m_strIdMpsTrack) - 1)
                    End If
                End If
                '----------------------------------
                'Check to see if a comma is present
                '----------------------------------
                intInstrChk = InStr(m_strLineItem, ",")
                If intInstrChk > 0 Then
                    '--------------------------------------
                    'Split by comma into a 1d variant array
                    '--------------------------------------
                    vrtArray = Split(m_strLineItem, ",")
                    '-------------------------------
                    'disregard if less than 3 params
                    '-------------------------------
                    If UBound(vrtArray) > 2 Then
                        '---------------------------------------
                        'Grab second param (north south control)
                        'and move down depending on label stock
                        '---------------------------------------
                        intSecondParam = CInt(vrtArray(1))
                        If intSecondParam >= 141 Then
                            ' Put the doctab offset into a procedure
                            intSecondParam = intSecondParam + EightInchOffset
                        Else
                            If m_strLabelStock = "0" Then
                                '-------------------------------
                                'else, blank doc for later input
                                '-------------------------------
                                m_strLineItem = ""
                             Else
                                If m_strDocTabInfo = "0" Then
                                    'do nothing
                                ElseIf m_strDocTabInfo = 1 Then
                                    m_strLineItem = ""
                                ElseIf m_strDocTabInfo = 2 Then
                                    m_strLineItem = ""
                                ElseIf m_strDocTabInfo = 3 Then
                                    m_strLineItem = ""
                                ElseIf m_strDocTabInfo = 4 Then
                                    m_strLineItem = ""
                                ElseIf m_strDocTabInfo = 5 Then
                                    m_strLineItem = ""
                                End If
                             End If
                        End If
                        '--------------------------------
                        'Start Array Element counter at 0
                        '--------------------------------
                        intElementCounter = 0
                        strNewLineItem = ""
                        '------------------------------------------------
                        'Loop through array by element and write out data
                        'changing vertical control by 2 inches
                        '------------------------------------------------
                        Do While UBound(vrtArray) >= intElementCounter
                            '----------------------------------------
                            'If line is blank, doctab is being erased
                            'for later use.
                            '----------------------------------------
                            If Trim(m_strLineItem) = "" Then
                                Exit Do
                            Else
                                If intElementCounter = 1 Then
                                    strNewLineItem = strNewLineItem & intSecondParam & ","
                                '---------------------------------
                                'If last element, do not add comma
                                '---------------------------------
                                ElseIf intElementCounter = UBound(vrtArray) Then
                                    strNewLineItem = strNewLineItem & vrtArray(intElementCounter)
                                Else
                                '--------------------------------
                                'Else write element out unchanged
                                '--------------------------------
                                    strNewLineItem = strNewLineItem & vrtArray(intElementCounter) & ","
                                End If
                                intElementCounter = intElementCounter + 1
                            End If
                        Loop


                            ' 2009-07-21, JFW
                            If m_boolTDMPS And m_lngTDMPSPieceCount <> 0 And m_lngTDMPSTotalCount <> 0 Then
                                If (intSecondParam >= 600 And intSecondParam <= 1100) Then
                                    If 0 <> InStr(1, strNewLineItem, ",""1""") Then
                                        If m_boolTDMPSToggle Then
                                            strNewLineItem = Replace(strNewLineItem, ",""1""", ",""" & m_lngTDMPSTotalCount & """")
                                            If m_lngTDMPSPieceCount >= m_lngTDMPSTotalCount Then
                                                m_lngTDMPSPieceCount = 0
                                                m_lngTDMPSTotalCount = 0
                                            End If
                                        Else
                                            strNewLineItem = Replace(strNewLineItem, ",""1""", ",""" & m_lngTDMPSPieceCount & """")
                                        End If
                                        m_boolTDMPSToggle = Not m_boolTDMPSToggle
                                    End If
                                End If
                            End If
                            

                        '---------------------------------
                        'Holds built new label in a string
                        '---------------------------------
                        m_strBuildNewLabel = m_strBuildNewLabel & strNewLineItem & vbCrLf

                    Else
                        If UBound(vrtArray) < 2 Then
                            '---------------------------------------------------------
                            'Commands before label printer prevent being able to print
                            'beyond a six inch buffer.  Removing commands until CLS
                            'is ready for 8"
                            '---------------------------------------------------------
                            m_strLineItem = ""
                            m_strBuildNewLabel = m_strBuildNewLabel & m_strLineItem
                        Else
                            m_strBuildNewLabel = m_strBuildNewLabel & m_strLineItem
                        End If
                    End If
                Else
                    '---------------------------------------------------------------------------
                    'Looks for "P1" or "P2" (last command in buffer to print label). When end of
                    'buffer is found, insert custom data then draw a line and add the "P1" to
                    'the end
                    '---------------------------------------------------------------------------
                    Dim strPrintCommand As String
                    If UCase(Trim(m_strLineItem)) = "P1" Or UCase(Trim(m_strLineItem)) = "P2" Or UCase(Trim(m_strLineItem)) = "P3" Then
                        
                        Select Case UCase(Trim(m_strLineItem))
                            Case "P1"
                                strPrintCommand = "P1"
                            Case "P2"
                                strPrintCommand = "P2"
                            Case "P3"
                                strPrintCommand = "P3"
                            Case Else
                                strPrintCommand = "P1"
                        End Select
                                                                              
                        '-----------------
                        'Check label stock
                        '-----------------
                        If m_strLabelStock = "0" Then
                            EplDocTabNO
                        Else
                            EplDocTabYES
                        End If
                        '----------------------------------------------------------------------------------
                        'Depending on label stock:
                        'D15 = Printer Heat   Qxxxx = Label Len   q812 = label width   ZT = print direction
                        '----------------------------------------------------------------------------------
                        If m_strLabelStock = "0" Then
                            m_strLineItem = m_strLineItem & vbCrLf & "OD10" & vbCrLf & "Q1625" & vbCrLf & "q812" & vbCrLf & "D15" & vbCrLf & "ZT" & vbCrLf & strPrintCommand & vbCrLf
                        Else
                            m_strLineItem = m_strLineItem & vbCrLf & "OD10" & vbCrLf & "Q1829" & vbCrLf & "q812" & vbCrLf & "D15" & vbCrLf & "ZT" & vbCrLf & strPrintCommand & vbCrLf
                        End If
                        
                        m_strBuildNewLabel = m_strBuildNewLabel & m_strLineItem
                            
                    '---------------------------------------------------
                    'When "N" is found, this is the end of the print job
                    '---------------------------------------------------
                    ElseIf UCase(Trim(m_strLineItem)) = "N" Then
                        m_strBuildNewLabel = m_strBuildNewLabel & vbCrLf & m_strLineItem & vbCrLf
                    Else
                        m_strLineItem = ""
                        m_strBuildNewLabel = m_strBuildNewLabel & m_strLineItem
                    End If
                    

                End If
               
        '----------------------
        'Loop until End Of File
        '----------------------
        Loop Until VBA.EOF(1)
            
     
    Exit Sub
    
EH:
  MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
  Or vbSystemModal, "modLabel8.EplChangeLabel"
    If False Then
        Resume
    End If
End Sub


Public Sub ZplChangeLabel()
'----------------------------------------------------------------------------
'Author: Domonic Grande emp 396671
'Called from: modLabel8.ProcessSingle or .ProcessBatch
'Purpose: This sub addresses ONLY ZPL BUFFERS.  It loops through an opened
'         label buffer (txt file) and moves the FedEx shipping label down
'         about 2" depending on the label stock.  Once room is made, it calls
'         a sub (depending on label stock) to add to the label requested
'         features from frmLabelConfig.
'----------------------------------------------------------------------------
        
    On Error GoTo EH
        
    Dim strNewLineItem As String
    Dim intInstrChk As Integer
    Dim vrtArray As Variant                'parses first by comma
    Dim vrtArrayParse As Variant           'parses elements of vrtArray by ^
    Dim intSecondParam As Integer          'print argument for vertical control
    Dim strBuildSecondParam As String      'second half of print argument
    Dim intElementCounter As Integer
    Dim intFreeFile As Integer
    

    Do
        '---------------------------------------------------
        'Read line from txt file (buffer) into m_strLineItem
        '---------------------------------------------------
        Line Input #1, m_strLineItem
        '---------------------------------------------------
        'If Id mps, grab tracking number from buffer and put
        'in var. Events don't match up to buffer files due
        'to when we get access to buffers.  Pulling trk from
        'buffer puts correct track on barcoded doctabs
        '---------------------------------------------------
        If UCase(m_strIDMps) = "Y" Then
            '------------------
            'Target "TRCK:" tag
            '------------------
            If InStr(m_strLineItem, Chr(34) & "TRCK:") > 0 Then
                m_strIdMpsTrack = ""
                Dim vrtParseTrack As Variant
                '-----------------------------
                'Parse line using tag as delim
                '-----------------------------
                vrtParseTrack = Split(m_strLineItem, "TRCK:")
                m_strIdMpsTrack = Trim(vrtParseTrack(1))
                m_strIdMpsTrack = Left(m_strIdMpsTrack, Len(m_strIdMpsTrack) - 1)
            End If
        End If
        '----------------------------------
        'Check to see if a comma is present
        '----------------------------------
        intInstrChk = InStr(m_strLineItem, ",")
        If intInstrChk > 0 Then
            '--------------------------------------
            'Split by comma into a 1d variant array
            '--------------------------------------
            vrtArray = Split(m_strLineItem, ",")
            '-----------------------------------------------
            'Pull element(1) from first split and parse by ^
            'this gives you the vertical control
            '-----------------------------------------------
            vrtArrayParse = Split(vrtArray(1), "^")
            '-------------------------------
            'disregard if less than 2 params
            '-------------------------------
            If UBound(vrtArray) > 1 And UBound(vrtArrayParse) > 0 Then
                
                '---------------------------------------
                'Grab second param (north south control)
                'and move down depending on label stock
                '---------------------------------------
                intSecondParam = CInt(vrtArrayParse(0))
                strBuildSecondParam = "^" & vrtArrayParse(1)
                
                If intSecondParam >= 145 Then
                    ' Doctab offset goes into a procedure
                    intSecondParam = intSecondParam + EightInchOffset
                Else
                    If m_strLabelStock = "0" Then
                        '-------------------------------
                        'else, blank doc for later input
                        '-------------------------------
                        m_strLineItem = ""
                     Else
                        If m_strDocTabInfo = "0" Then
                            'do nothing
                        ElseIf m_strDocTabInfo = 1 Then
                            m_strLineItem = ""
                        ElseIf m_strDocTabInfo = 2 Then
                            m_strLineItem = ""
                        ElseIf m_strDocTabInfo = 3 Then
                            ' Barcode on left, keep right column, columns are 10, 270, 540
                            If m_strLineItem < "^FO400" Then
                                m_strLineItem = ""
                            End If
                        ElseIf m_strDocTabInfo = 4 Then
                            ' Barcode on right, keep left column, columns are 10, 270, 540
                            If m_strLineItem > "^FO120," Then
                                m_strLineItem = ""
                            End If
                        ElseIf m_strDocTabInfo = 5 Then
                            m_strLineItem = ""
                        End If
                     End If
                End If
                '--------------------------------
                'Start Array Element counter at 0
                '--------------------------------
                intElementCounter = 0
                strNewLineItem = ""
                '------------------------------------------------
                'Loop through array by element and write out data
                'changing vertical control by 2 inches
                '------------------------------------------------
                Do While UBound(vrtArray) >= intElementCounter
                    '----------------------------------------
                    'If line is blank, doctab is being erased
                    'for later use.
                    '----------------------------------------
                    If Trim(m_strLineItem) = "" Then
                        Exit Do
                    Else
                        If intElementCounter = 1 Then
                            strNewLineItem = strNewLineItem & intSecondParam & strBuildSecondParam & ","
                        '---------------------------------
                        'If last element, do not add comma
                        '---------------------------------
                        ElseIf intElementCounter = UBound(vrtArray) Then
                            strNewLineItem = strNewLineItem & vrtArray(intElementCounter)
                        Else
                        '--------------------------------
                        'Else write element out unchanged
                        '--------------------------------
                            strNewLineItem = strNewLineItem & vrtArray(intElementCounter) & ","
                        End If
                        intElementCounter = intElementCounter + 1
                    End If
                Loop

                ' 2009-07-21, JFW
                If m_boolTDMPS And m_lngTDMPSPieceCount <> 0 And m_lngTDMPSTotalCount <> 0 Then
                    If (intSecondParam >= 600 And intSecondParam <= 1100) Then
                        If 0 <> InStr(1, strNewLineItem, "^FD1^FS") Then
                            If m_boolTDMPSToggle Then
                                strNewLineItem = Replace(strNewLineItem, "^FD1^FS", "^FD" & m_lngTDMPSTotalCount & "^FS")
                                If m_lngTDMPSPieceCount >= m_lngTDMPSTotalCount Then
                                    m_lngTDMPSPieceCount = 0
                                    m_lngTDMPSTotalCount = 0
                                End If
                            Else
                                strNewLineItem = Replace(strNewLineItem, "^FD1^FS", "^FD" & m_lngTDMPSPieceCount & "^FS")
                            End If
                            m_boolTDMPSToggle = Not m_boolTDMPSToggle
                        End If
                    End If
                End If

                If m_boolEnhanceReferences Then
                    If intSecondParam >= 300 And intSecondParam <= 600 Then
                        If 0 < InStr(1, strNewLineItem, "DEPT:") Then
                            strNewLineItem = Replace(strNewLineItem, "11,7", "17,17")
                            strNewLineItem = Replace(strNewLineItem, "^A0N", "^AbN")
                            strNewLineItem = Replace(strNewLineItem, ",378^", ",380^")
                            strNewLineItem = Replace(strNewLineItem, "428,", "38,")
                        ElseIf 0 < InStr(1, strNewLineItem, "INV:") Then
                            strNewLineItem = ""
                        ElseIf 0 < InStr(1, strNewLineItem, "PO:") Then
                            strNewLineItem = ""
                        ElseIf 0 < InStr(1, strNewLineItem, "REF:") Then
                            strNewLineItem = Replace(strNewLineItem, "11,7", "20,18")
                            strNewLineItem = Replace(strNewLineItem, "^A0N", "^AbN")
                            strNewLineItem = Replace(strNewLineItem, ",355^", ",371^")
                            strNewLineItem = Replace(strNewLineItem, ",364^", ",370^")
                        End If
                    End If
                End If
                
                '---------------------------------
                'Holds built new label in a string
                '---------------------------------
                m_strBuildNewLabel = m_strBuildNewLabel & strNewLineItem & vbCrLf

            Else
                '------------------------
                'write line out unchanged
                '------------------------
                m_strBuildNewLabel = m_strBuildNewLabel & m_strLineItem
            End If
        
        Else ' Non print line
            '--------------------------------------------------------------------------------
            'Looks for "^PQ1" or "^PQ2" (last command in buffer to print label). When end of
            'buffer is found, insert custom data then draw a line and add the "P1" to the end
            '--------------------------------------------------------------------------------
            Dim strPrintCommand As String
            If UCase(Trim(m_strLineItem)) = "^PQ1" Or UCase(Trim(m_strLineItem)) = "^PQ2" Or UCase(Trim(m_strLineItem)) = "^PQ3" Then

                Select Case UCase(Trim(m_strLineItem))
                    Case "^PQ1"
                        strPrintCommand = "^PQ1"
                    Case "^PQ2", "P2"
                        strPrintCommand = "^PQ2"
                    Case "^PQ3", "P3"
                        strPrintCommand = "^PQ3"
                    Case Else
                        strPrintCommand = "^PQ1"
                End Select
                
                '-----------------
                'Check label stock
                '-----------------
                If m_strLabelStock = "0" Then   '8 no doc
                    ZplDocTabNO
                Else
                    ZplDocTabYES
                End If
                
                ' Customer custom doc tab
                If m_strIDMps = "Y" Then
                    Call Cafe1.ZplCustomLabel(m_strIdMpsTrack, m_strLineItem)
                Else
                    Call Cafe1.ZplCustomLabel(m_strTrackingNumber, m_strLineItem)
                End If
                
                ' 2010-03-10, JFW, New Cafe has no TD label numbers, must add lines
                If Cafe1.Version >= "CAFE2440" Then
                If m_boolTDMPS And m_lngTDMPSPieceCount <> 0 And m_lngTDMPSTotalCount <> 0 Then
                    m_strLineItem = m_strLineItem & vbCrLf & "^FO650,620^A0N,25,27^FWN^FH^FD" & m_lngTDMPSPieceCount & "^FS"
                    m_strLineItem = m_strLineItem & vbCrLf & "^FO650,675^A0N,25,27^FWN^FH^FDof^FS"
                    m_strLineItem = m_strLineItem & vbCrLf & "^FO650,710^A0N,25,27^FWN^FH^FD" & m_lngTDMPSTotalCount & "^FS"
                    ' Label print problem, no number of 'found' labels
                    m_lngTDMPSPieceCount = 0
                End If
                End If
                
                m_strLineItem = m_strLineItem & vbCrLf & strPrintCommand
                m_strBuildNewLabel = m_strBuildNewLabel & m_strLineItem
                    
            ElseIf UCase(Trim(m_strLineItem)) = "^XZ" Then
                m_strBuildNewLabel = m_strBuildNewLabel & vbCrLf & m_strLineItem & vbCrLf
            Else
                m_strLineItem = ""
                m_strBuildNewLabel = m_strBuildNewLabel & m_strLineItem
            End If
            
        End If
           
    '----------------------
    'Loop until End Of File
    '----------------------
    Loop Until VBA.EOF(1)
            
     
    Exit Sub
    
EH:
  MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
  Or vbSystemModal, "modLabel8.ZplChangeLabel"
    If False Then
        Resume
    End If
    
End Sub



Private Sub EplDocTabNO()
'--------------------------------------------------------------------------------
'Author: Domonic Grande emp 396671
'Called from: modLabel8.EplChangeLabel
'Purpose: This sub takes the settins provided by frmConfigLabel (held in the reg)
'         and adds EPL code to the label buffer
'--------------------------------------------------------------------------------
   On Error GoTo EH
   
    ' 2007-11-09, JFW, Flexible ref choice on 2 ref option
    Dim lngVertical As Long
    
        '-------------------------------------------------
        'Writes comment into epl with overline & underline
        '-------------------------------------------------
        m_strLineItem = vbCrLf & ";------------------" & vbCrLf & ";CUSTOM LABEL BELOW" & vbCrLf & ";------------------" & vbCrLf
        '-----------------------------------------
        'Draws line between FedEx label and custom
        '-----------------------------------------
        ' 2009-07-21, JFW
        ' 2010-12-29, JFW, Line not necessary for Sig Reqd label
        If m_strLabelFeatureSet <> "6" And m_strLabelFeatureSet <> "5" Then
            m_strLineItem = m_strLineItem & "LO10,405,790,2" & vbCrLf
        End If
        
        Select Case m_strLabelFeatureSet
            '----------------------
            'Refs, message and Logo
            '----------------------
            Case "0"
                '--------------------------------
                'Holds 30 char line out of messge
                '--------------------------------
                Dim strMessageLine As String
                '---------------------------------------------------------------------------------------------
                'Holds the complete message broken into 5 or 10 lines (depending on len with "^" between lines
                '---------------------------------------------------------------------------------------------
                Dim strParseMessage As String
                '---------------------------------------------------
                'Tells how long to print the message line (30 or 60)
                '---------------------------------------------------
                Dim intLineLen As Integer
                '------------------------------
                'Trim message down to 300 chars
                '------------------------------
                m_strMessage = Left(Trim(m_strMessage), 300)
                '-------------------------------------------
                'Need a var in current scope to check status
                '-------------------------------------------
                Dim strCompleteText As String
                strCompleteText = m_strMessage
                '-----------------------------------------------------------------
                'strCompleteText will start off with the entire message then after
                'the function call it will be stripped of the chars printed line
                'by line until the loop is exited.
                '-----------------------------------------------------------------
                Do Until strCompleteText = ""
                    '---------------------------------------------------------------
                    'Check to see which features are being used.  If logo or other
                    'refs are being used, set the len for the message lines to print
                    '---------------------------------------------------------------
                    If Trim(m_strLogo) = "0" Or Trim(m_strRefOptions) = "1" Then
                        intLineLen = 30
                    ElseIf Trim(m_strLogo) = "1" Or Trim(m_strRefOptions) = "2" Then
                        intLineLen = 60
                    Else
                        intLineLen = 30
                    End If
                    ' 2007-11-09, JFW, I should get 60 char line, but logic above somehow goes 30
                    intLineLen = 60
                        '------------------------------------------------------------
                        'Call function to break message up into lines (len) depending
                        'on other features used
                        '------------------------------------------------------------
                        strMessageLine = modLabel8.WordWrap(strCompleteText, intLineLen)
                        '-------------------------------------------------------------
                        'Container to hold the message with a "^" between lines.  It's
                        'parsed below so each line can be printed separate.
                        '-------------------------------------------------------------
                        If Trim(strParseMessage) = "" Then
                            strParseMessage = strMessageLine
                        Else
                            strParseMessage = strParseMessage & "^" & strMessageLine
                        End If
                Loop
                '------------------------
                'Split message out by "^"
                '------------------------
                Dim vrtMessageArray As Variant
                vrtMessageArray = Split(strParseMessage, "^")
                '-----------------------------------------
                'use ubound to see when data can be mapped
                '-----------------------------------------
                Dim intMessageCount As Integer
                intMessageCount = UBound(vrtMessageArray)
                '-----------------------------------------------
                'Parsing the message field into (up to) 10 lines
                '-----------------------------------------------
                If intMessageCount >= 0 Then
                    Dim strMsgLine1 As String
                    strMsgLine1 = vrtMessageArray(0)
                End If
                If intMessageCount >= 1 Then
                    Dim strMsgLine2 As String
                    strMsgLine2 = vrtMessageArray(1)
                End If
                If intMessageCount >= 2 Then
                    Dim strMsgLine3 As String
                    strMsgLine3 = vrtMessageArray(2)
                End If
                If intMessageCount >= 3 Then
                    Dim strMsgLine4 As String
                    strMsgLine4 = vrtMessageArray(3)
                End If
                If intMessageCount >= 4 Then
                    Dim strMsgLine5 As String
                    strMsgLine5 = vrtMessageArray(4)
                End If
                If intMessageCount >= 5 Then
                    Dim strMsgLine6 As String
                    strMsgLine6 = vrtMessageArray(5)
                End If
                If intMessageCount >= 6 Then
                    Dim strMsgLine7 As String
                    strMsgLine7 = vrtMessageArray(6)
                End If
                If intMessageCount >= 7 Then
                    Dim strMsgLine8 As String
                    strMsgLine8 = vrtMessageArray(7)
                End If
                If intMessageCount >= 8 Then
                    Dim strMsgLine9 As String
                    strMsgLine9 = vrtMessageArray(8)
                End If
                If intMessageCount >= 9 Then
                    Dim strMsgLine10 As String
                    strMsgLine10 = vrtMessageArray(9)
                End If
                
                '-------------------
                'Writes customer URL
                '-------------------
                m_strLineItem = m_strLineItem & "A425,405,0,2,1,1,N," & Chr(34) & m_strURL & Chr(34) & vbCrLf
                    '-------
                    'If logo
                    '-------
                    If m_strLogo = "0" Then
                         m_strLineItem = m_strLineItem & "GG435,50," & Chr(34) & "LOGO1" & Chr(34) & vbCrLf
                    '----------
                    'If NO logo
                    '----------
                    Else
                        m_strLineItem = m_strLineItem
                    End If
             
                    '--------------------------------------------------------
                    '**********Reference for below code**************
                    '"A25,40,0,2,1,2,N,"
                    'A - Printing Text ('B' would be barcode)
                    '25 - starting horizontal position
                    '40 starting vertical position
                    '0 - rotation
                    '2 - font size
                    '1 - horizontal multiplier, expand text horizontally (X2)
                    '2 - vertical multiplier, expand text vetically (X2)
                    'N - normal image
                    '--------------------------------------------------------
                    
                    '-----------
                    'Ref Options
                    '-----------
                    Select Case m_strRefOptions
                        '-------
                        '4 ref's
                        '-------
                        Case 0
                            Select Case m_strRefFormat
                                '-------------------
                                'human readable only
                                '-------------------
                                Case 0
                                    m_strLineItem = m_strLineItem & "A25,15,0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,40,0,2,1,2,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                    
                                    m_strLineItem = m_strLineItem & "A25,105,0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,130,0,2,1,2,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                    
                                    m_strLineItem = m_strLineItem & "A25,195,0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,220,0,2,1,2,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                    
                                    m_strLineItem = m_strLineItem & "A25,285,0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,310,0,2,1,2,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                '------------
                                'Barcode only
                                '------------
                                Case 1
                                    m_strLineItem = m_strLineItem & "A25,15,0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                    If Trim(m_strRef1) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,40,0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,105,0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                    If Trim(m_strRef2) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,130,0,1,2,6,40,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,195,0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                    If Trim(m_strRef3) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,220,0,1,2,6,40,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,285,0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                    If Trim(m_strRef4) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,310,0,1,2,6,40,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                    End If
                                '---------------------
                                'BARCODES AND READABLE
                                '---------------------
                                Case 2
                                    m_strLineItem = m_strLineItem & "A25,15,0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,40,0,2,1,1,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                    If Trim(m_strRef1) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,60,0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,105,0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,130,0,2,1,1,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                    If Trim(m_strRef2) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,150,0,1,2,6,40,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,195,0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,220,0,2,1,1,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                    If Trim(m_strRef3) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,240,0,1,2,6,40,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,285,0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,310,0,2,1,1,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                    If Trim(m_strRef4) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,330,0,1,2,6,40,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                    End If
                                Case Else
                             End Select
                        '-----------------
                        '2 ref's & message
                        '-----------------
                        Case 1
                            Select Case m_strRefFormat
                                '--------------
                                'human readable
                                '--------------
                                Case 0
                                    lngVertical = 15
                                    If m_strRef1Cap <> "" Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,2,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                        lngVertical = lngVertical + 60
                                    End If
                                    If m_strRef2Cap <> "" And lngVertical <= 75 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,2,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                        lngVertical = lngVertical + 60
                                    End If
                                    If m_strRef3Cap <> "" And lngVertical <= 75 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,2,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                        lngVertical = lngVertical + 60
                                    End If
                                    If m_strRef4Cap <> "" And lngVertical <= 75 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,2,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                        lngVertical = lngVertical + 60
                                    End If
                                    '-------------
                                    'message field
                                    '-------------
                                    m_strLineItem = m_strLineItem & "A25,145,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,175,0,2,1,1,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,195,0,2,1,1,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,215,0,2,1,1,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,235,0,2,1,1,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,255,0,2,1,1,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,275,0,2,1,1,N," & Chr(34) & strMsgLine6 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,295,0,2,1,1,N," & Chr(34) & strMsgLine7 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,315,0,2,1,1,N," & Chr(34) & strMsgLine8 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,335,0,2,1,1,N," & Chr(34) & strMsgLine9 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,355,0,2,1,1,N," & Chr(34) & strMsgLine10 & Chr(34) & vbCrLf
                                '------------
                                'barcode only
                                '------------
                                Case 1
                                    lngVertical = 15
                                    If m_strRef1Cap <> "" And lngVertical <= 90 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                        If Trim(m_strRef1) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 25) & ",0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 75
                                    End If
                                    If m_strRef2Cap <> "" And lngVertical <= 90 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                        If Trim(m_strRef2) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 25) & ",0,1,2,6,40,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 75
                                    End If
                                    If m_strRef3Cap <> "" And lngVertical <= 90 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                        If Trim(m_strRef3) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 25) & ",0,1,2,6,40,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 75
                                    End If
                                    If m_strRef4Cap <> "" And lngVertical <= 90 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                        If Trim(m_strRef4) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 25) & ",0,1,2,6,40,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 75
                                    End If
                                    '-------------
                                    'message field
                                    '-------------
                                    m_strLineItem = m_strLineItem & "A25,180,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,210,0,2,1,1,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,230,0,2,1,1,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,250,0,2,1,1,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,270,0,2,1,1,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,290,0,2,1,1,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,310,0,2,1,1,N," & Chr(34) & strMsgLine6 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,330,0,2,1,1,N," & Chr(34) & strMsgLine7 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,350,0,2,1,1,N," & Chr(34) & strMsgLine8 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,370,0,2,1,1,N," & Chr(34) & strMsgLine9 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,390,0,2,1,1,N," & Chr(34) & strMsgLine10 & Chr(34) & vbCrLf
                                '------------------------
                                'Human readable & barcode
                                '------------------------
                                Case 2
                                    lngVertical = 15
                                    If m_strRef1Cap <> "" And lngVertical <= 105 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,1,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                        If Trim(m_strRef1) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 45) & ",0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 90
                                    End If
                                    If m_strRef2Cap <> "" And lngVertical <= 105 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,1,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                        If Trim(m_strRef2) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 45) & ",0,1,2,6,40,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 90
                                    End If
                                    If m_strRef3Cap <> "" And lngVertical <= 105 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,1,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                        If Trim(m_strRef3) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 45) & ",0,1,2,6,40,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 90
                                    End If
                                    If m_strRef4Cap <> "" And lngVertical <= 105 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,1,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                        If Trim(m_strRef4) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 45) & ",0,1,2,6,40,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 90
                                    End If
                                    '-------------
                                    'message field
                                    '-------------
                                    m_strLineItem = m_strLineItem & "A25,200,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,230,0,2,1,1,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,250,0,2,1,1,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,270,0,2,1,1,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,290,0,2,1,1,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,310,0,2,1,1,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,330,0,2,1,1,N," & Chr(34) & strMsgLine6 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,350,0,2,1,1,N," & Chr(34) & strMsgLine7 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,370,0,2,1,1,N," & Chr(34) & strMsgLine8 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,390,0,2,1,1,N," & Chr(34) & strMsgLine9 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,410,0,2,1,1,N," & Chr(34) & strMsgLine10 & Chr(34) & vbCrLf
                                Case Else
                             End Select
                        '------------
                        'message only
                        '------------
                        Case 2
                            '-----------------------------------------------------
                            'if no logo and message only, use whole width of label
                            '-----------------------------------------------------
                            If m_strLogo = "0" Then
                                m_strLineItem = m_strLineItem & "A25,145,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,175,0,2,1,1,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,195,0,2,1,1,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,215,0,2,1,1,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,235,0,2,1,1,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,255,0,2,1,1,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,275,0,2,1,1,N," & Chr(34) & strMsgLine6 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,295,0,2,1,1,N," & Chr(34) & strMsgLine7 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,315,0,2,1,1,N," & Chr(34) & strMsgLine8 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,335,0,2,1,1,N," & Chr(34) & strMsgLine9 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,355,0,2,1,1,N," & Chr(34) & strMsgLine10 & Chr(34) & vbCrLf
                            '------------
                            'message only
                            '------------
                            Else
                                m_strLineItem = m_strLineItem & "A25,145,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,175,0,2,1,2,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,215,0,2,1,2,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,255,0,2,1,2,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,295,0,2,1,2,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,335,0,2,1,2,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                            End If
                        Case Else
                    End Select
            Case "1"
                '------------------------------------------------------------------------------------
                'The below code prints a pick ticket on the 2" space above the FedEx Common Label
                'on 8" label stock.  See the UserDefinedType (PickTicketValues) in modLabel8 (dec's).
                '------------------------------------------------------------------------------------
                With m_udtPickTicket
                    '-----
                    'Ref's
                    '-----
                    m_strLineItem = m_strLineItem & "A10,15,0,4,1,1,N," & Chr(34) & .BatchIdCap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,15,0,4,1,1,N," & Chr(34) & .BatchId & Chr(34) & vbCrLf
        
                    m_strLineItem = m_strLineItem & "A10,40,0,4,1,1,N," & Chr(34) & .PicRef1Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,40,0,4,1,1,N," & Chr(34) & .PicRef1 & Chr(34) & vbCrLf
        
                    m_strLineItem = m_strLineItem & "A10,65,0,4,1,1,N," & Chr(34) & .PicRef2Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,65,0,4,1,1,N," & Chr(34) & .PicRef2 & Chr(34) & vbCrLf
    
                    m_strLineItem = m_strLineItem & "A10,90,0,4,1,1,N," & Chr(34) & .PicRef3Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,90,0,4,1,1,N," & Chr(34) & .PicRef3 & Chr(34) & vbCrLf
    
                    m_strLineItem = m_strLineItem & "A10,115,0,4,1,1,N," & Chr(34) & .PicRef4Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,115,0,4,1,1,N," & Chr(34) & .PicRef4 & Chr(34) & vbCrLf
                   '-----------
                   'COL HEADERS
                   '-----------
                    m_strLineItem = m_strLineItem & "A60,150,0,4,1,1,N," & Chr(34) & .ColHeader1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,150,0,4,1,1,N," & Chr(34) & .ColHeader2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,150,0,4,1,1,N," & Chr(34) & .ColHeader3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,150,0,4,1,1,N," & Chr(34) & .ColHeader4 & Chr(34) & vbCrLf
                    '----
                    'row1
                    '----
                    m_strLineItem = m_strLineItem & "A60,175,0,2,1,1,N," & Chr(34) & .Row01Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,175,0,2,1,1,N," & Chr(34) & .Row01Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,175,0,2,1,1,N," & Chr(34) & .Row01Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,175,0,2,1,1,N," & Chr(34) & .Row01Col4 & Chr(34) & vbCrLf
                    '----
                    'row2
                    '----
                    m_strLineItem = m_strLineItem & "A60,195,0,2,1,1,N," & Chr(34) & .Row02Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,195,0,2,1,1,N," & Chr(34) & .Row02Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,195,0,2,1,1,N," & Chr(34) & .Row02Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,195,0,2,1,1,N," & Chr(34) & .Row02Col4 & Chr(34) & vbCrLf
                    '----
                    'row3
                    '----
                    m_strLineItem = m_strLineItem & "A60,215,0,2,1,1,N," & Chr(34) & .Row03Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,215,0,2,1,1,N," & Chr(34) & .Row03Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,215,0,2,1,1,N," & Chr(34) & .Row03Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,215,0,2,1,1,N," & Chr(34) & .Row03Col4 & Chr(34) & vbCrLf
                    '----
                    'row4
                    '----
                    m_strLineItem = m_strLineItem & "A60,235,0,2,1,1,N," & Chr(34) & .Row04Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,235,0,2,1,1,N," & Chr(34) & .Row04Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,235,0,2,1,1,N," & Chr(34) & .Row04Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,235,0,2,1,1,N," & Chr(34) & .Row04Col4 & Chr(34) & vbCrLf
                    '----
                    'row5
                    '----
                    m_strLineItem = m_strLineItem & "A60,255,0,2,1,1,N," & Chr(34) & .Row05Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,255,0,2,1,1,N," & Chr(34) & .Row05Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,255,0,2,1,1,N," & Chr(34) & .Row05Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,255,0,2,1,1,N," & Chr(34) & .Row05Col4 & Chr(34) & vbCrLf
                    '----
                    'row6
                    '----
                    m_strLineItem = m_strLineItem & "A60,275,0,2,1,1,N," & Chr(34) & .Row06Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,275,0,2,1,1,N," & Chr(34) & .Row06Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,275,0,2,1,1,N," & Chr(34) & .Row06Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,275,0,2,1,1,N," & Chr(34) & .Row06Col4 & Chr(34) & vbCrLf
                    '----
                    'row7
                    '----
                    m_strLineItem = m_strLineItem & "A60,295,0,2,1,1,N," & Chr(34) & .Row07Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,295,0,2,1,1,N," & Chr(34) & .Row07Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,295,0,2,1,1,N," & Chr(34) & .Row07Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,295,0,2,1,1,N," & Chr(34) & .Row07Col4 & Chr(34) & vbCrLf
                    '----
                    'row8
                    '----
                    m_strLineItem = m_strLineItem & "A60,315,0,2,1,1,N," & Chr(34) & .Row08Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,315,0,2,1,1,N," & Chr(34) & .Row08Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,315,0,2,1,1,N," & Chr(34) & .Row08Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,315,0,2,1,1,N," & Chr(34) & .Row08Col4 & Chr(34) & vbCrLf
                    '----
                    'row9
                    '----
                    m_strLineItem = m_strLineItem & "A60,335,0,2,1,1,N," & Chr(34) & .Row09Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,335,0,2,1,1,N," & Chr(34) & .Row09Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,335,0,2,1,1,N," & Chr(34) & .Row09Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,335,0,2,1,1,N," & Chr(34) & .Row09Col4 & Chr(34) & vbCrLf
                    '-----
                    'row10
                    '-----
                    m_strLineItem = m_strLineItem & "A60,355,0,2,1,1,N," & Chr(34) & .Row10Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,355,0,2,1,1,N," & Chr(34) & .Row10Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,355,0,2,1,1,N," & Chr(34) & .Row10Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,355,0,2,1,1,N," & Chr(34) & .Row10Col4 & Chr(34) & vbCrLf
                    '---------------
                    'Footer captions
                    '---------------
                    m_strLineItem = m_strLineItem & "A10,390,0,3,1,1,N," & Chr(34) & .TicketFooter1Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A250,390,0,3,1,1,N," & Chr(34) & .TicketFooter2Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,390,0,3,1,1,N," & Chr(34) & .TicketFooter3Cap & Chr(34) & vbCrLf
                    '-------
                    'Footers
                    '-------
                    m_strLineItem = m_strLineItem & "A148,393,0,2,1,1,N," & Chr(34) & .TicketFooter1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A380,393,0,2,1,1,N," & Chr(34) & .TicketFooter2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A640,393,0,2,1,1,N," & Chr(34) & .TicketFooter3 & Chr(34) & vbCrLf
                    
                End With
            '------
            'SortID
            '------
            Case "2"
                '-------------------------------------------------------
                'Depending on fonts size selected, print sort id feature
                '-------------------------------------------------------
                If Trim(m_strSortIdFontSize) = "0" Then
                    '--------------------------------------------------------------------
                    'Data being converted to ucase because font used does not allow lower
                    '--------------------------------------------------------------------
                    m_strSortID = UCase(Left(Trim(m_strSortID), 5))
                    m_strLineItem = m_strLineItem & "A50,10,0,5,4,8,N," & Chr(34) & m_strSortID & Chr(34) & vbCrLf
                ElseIf Trim(m_strSortIdFontSize) = "1" Then
                    m_strSortID = UCase(Left(Trim(m_strSortID), 12))
                    m_strLineItem = m_strLineItem & "A20,10,0,4,4,8,N," & Chr(34) & m_strSortID & Chr(34) & vbCrLf
                Else
                    'do nothing
                End If
            '------
            'sscc18
            '------
            Case "3"
                '-------
                'Barcode
                '-------
                m_strLineItem = m_strLineItem & "B150,100,0,0,3,4,210,N," & Chr(34) & m_strSSCC18 & Chr(34) & vbCrLf
                '---------------------------------------------------
                'Human readable broken out to look industry standard
                '---------------------------------------------------
                m_strLineItem = m_strLineItem & "A150,320,0,2,1,2,N," & Chr(34) & "(" & Left(m_strSSCC18, 2) & _
                ")" & Space(2) & Mid(m_strSSCC18, 3, 18) & Chr(34) & vbCrLf
            '-----------------
            'Bed Bath & Beyond
            '-----------------
            Case "4"
                With m_udtBedBathBeyond
                    '--------------
                    'sscc18 Barcode
                    '--------------
                    m_strLineItem = m_strLineItem & "B150,160,0,0,3,4,210,N," & Chr(34) & .SSCC18 & Chr(34) & vbCrLf
                    '--------------
                    'Human Readable
                    '--------------
                    m_strLineItem = m_strLineItem & "A150,380,0,2,1,2,N," & Chr(34) & "SSCC18 - " & "(" & Left(.SSCC18, 2) & _
                    ")" & Space(2) & Mid(.SSCC18, 3, 18) & Chr(34) & vbCrLf
                    '---------
                    'Po Number
                    '---------
                    m_strLineItem = m_strLineItem & "A10,10,0,4,1,1,N," & Chr(34) & "PO #: " & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A100,10,0,5,1,1,N," & Chr(34) & .PoNumber & Chr(34) & vbCrLf
                    '------------
                    'Store Number
                    '------------
                    m_strLineItem = m_strLineItem & "A200,90,0,4,1,1,N," & Chr(34) & "Store #: " & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A340,90,0,5,1,1,N," & Chr(34) & .StoreNumber & Chr(34) & vbCrLf
                    '-------------
                    'Vendor Number
                    '-------------
                    m_strLineItem = m_strLineItem & "A400,10,0,4,1,1,N," & Chr(34) & "Vendor #: " & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A555,10,0,5,1,1,N," & Chr(34) & .VendorNumber & Chr(34) & vbCrLf
                    
                End With
            '------
            'signature required
            '------
            Case "5"
                If True Or Cafe1.SignatureRequiredStyle = 1 Then
                    m_strLineItem = m_strLineItem & "LO30,20,730,10" & vbCrLf
                    m_strLineItem = m_strLineItem & "LO30,20,10,370" & vbCrLf
                    m_strLineItem = m_strLineItem & "LO755,20,10,370" & vbCrLf
                    m_strLineItem = m_strLineItem & "LO30,385,735,10" & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,50,0,3,2,3,R," & Chr(34) & "   SIGNATURE REQUIRED   " & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,135,0,3,1,2,N," & Chr(34) & "DELIVER TO CONSIGNEE'S ADDRESS ONLY" & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,175,0,2,1,2,N," & Chr(34) & "  * No Indirect Delivery" & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,215,0,2,1,2,N," & Chr(34) & "  * No Delivery Release Signature" & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,285,0,3,1,2,N," & Chr(34) & "LIVRER UNIQUEMENT A L'ADRESSE DU DESTINATAIRE" & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,325,0,2,1,2,N," & Chr(34) & "  * Aucune livraison indirecte ni signature de decharge" & Chr(34) & vbCrLf
                End If
            '------
            'FedEx Canada custom bar code
            '------
            Case "6"
                ' Nothing to do here
             
            Case Else
                MsgBox "Label feature set not defined", vbExclamation, "Error"
        End Select
    Exit Sub
    
EH:
  MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
  Or vbSystemModal, "modLabel8.EplDocTabNo"
                        
End Sub


Private Sub ZplDocTabNO()
'--------------------------------------------------------------------------------
'Author: Domonic Grande emp 396671
'Called from: modLabel8.ZplChangeLabel
'Purpose: This sub takes the settins provided by frmConfigLabel (held in the reg)
'         and adds ZPL code to the label buffer
'--------------------------------------------------------------------------------

   On Error GoTo EH
   
    
        '-----------------------
        'Writes comment into zpl
        '-----------------------
        m_strLineItem = vbCrLf & "^FX **********CUSTOM LABEL BELOW********** FS^" & vbCrLf
        '-----------------------------------------
        'Draws line between FedEx label and custom
        '-----------------------------------------
        ' 2009-07-21, JFW
        ' 2010-12-29, JFW, Line not necessary for Sig Reqd label
        If m_strLabelFeatureSet <> "6" And m_strLabelFeatureSet <> "5" Then
            m_strLineItem = m_strLineItem & "^FO10,405^GB790,2,2^FS" & vbCrLf
        End If
        
        Select Case m_strLabelFeatureSet
            Case "0"
                '--------------------------------
                'Holds 30 char line out of messge
                '--------------------------------
                Dim strMessageLine As String
                '---------------------------------------------------------------------------------------------
                'Holds the complete message broken into 5 or 10 lines (depending on len with "^" between lines
                '---------------------------------------------------------------------------------------------
                Dim strParseMessage As String
                '---------------------------------------------------
                'Tells how long to print the message line (30 or 60)
                '---------------------------------------------------
                Dim intLineLen As Integer
                '------------------------------
                'Trim message down to 300 chars
                '------------------------------
                m_strMessage = Left(Trim(m_strMessage), 300)
                '-------------------------------------------
                'Need a var in current scope to check status
                '-------------------------------------------
                Dim strCompleteText As String
                strCompleteText = m_strMessage
                '-----------------------------------------------------------------
                'strCompleteText will start off with the entire message then after
                'the function call it will be stripped of the chars printed line
                'by line until the loop is exited.
                '-----------------------------------------------------------------
                Do Until strCompleteText = ""
                    '---------------------------------------------------------------
                    'Check to see which features are being used.  If logo or other
                    'refs are being used, set the len for the message lines to print
                    '---------------------------------------------------------------
                    If Trim(m_strLogo) = "0" Or Trim(m_strRefOptions) = "1" Then
                        intLineLen = 30
                    ElseIf Trim(m_strLogo) = "1" Or Trim(m_strRefOptions) = "2" Then
                        intLineLen = 60
                    Else
                        intLineLen = 30
                    End If
                    ' 2007-11-09, JFW, I should get 60 char line, but logic above somehow goes 30
                    intLineLen = 60
                        '------------------------------------------------------------
                        'Call function to break message up into lines (len) depending
                        'on other features used
                        '------------------------------------------------------------
                        strMessageLine = modLabel8.WordWrap(strCompleteText, intLineLen)
                        '-------------------------------------------------------------
                        'Container to hold the message with a "^" between lines.  It's
                        'parsed below so each line can be printed separate.
                        '-------------------------------------------------------------
                        If Trim(strParseMessage) = "" Then
                            strParseMessage = strMessageLine
                        Else
                            strParseMessage = strParseMessage & "^" & strMessageLine
                        End If
                Loop
                
                '------------------------
                'Split message out by "^"
                '------------------------
                Dim vrtMessageArray As Variant
                vrtMessageArray = Split(strParseMessage, "^")
                '-----------------------------------------
                'use ubound to see when data can be mapped
                '-----------------------------------------
                Dim intMessageCount As Integer
                intMessageCount = UBound(vrtMessageArray)
                '-----------------------------------------------
                'Parsing the message field into (up to) 10 lines
                '-----------------------------------------------
                If intMessageCount >= 0 Then
                    Dim strMsgLine1 As String
                    strMsgLine1 = vrtMessageArray(0)
                End If
                If intMessageCount >= 1 Then
                    Dim strMsgLine2 As String
                    strMsgLine2 = vrtMessageArray(1)
                End If
                If intMessageCount >= 2 Then
                    Dim strMsgLine3 As String
                    strMsgLine3 = vrtMessageArray(2)
                End If
                If intMessageCount >= 3 Then
                    Dim strMsgLine4 As String
                    strMsgLine4 = vrtMessageArray(3)
                End If
                If intMessageCount >= 4 Then
                    Dim strMsgLine5 As String
                    strMsgLine5 = vrtMessageArray(4)
                End If
                If intMessageCount >= 5 Then
                    Dim strMsgLine6 As String
                    strMsgLine6 = vrtMessageArray(5)
                End If
                If intMessageCount >= 6 Then
                    Dim strMsgLine7 As String
                    strMsgLine7 = vrtMessageArray(6)
                End If
                If intMessageCount >= 7 Then
                    Dim strMsgLine8 As String
                    strMsgLine8 = vrtMessageArray(7)
                End If
                If intMessageCount >= 8 Then
                    Dim strMsgLine9 As String
                    strMsgLine9 = vrtMessageArray(8)
                End If
                If intMessageCount >= 9 Then
                    Dim strMsgLine10 As String
                    strMsgLine10 = vrtMessageArray(9)
                End If

                '-------------------
                'Writes customer URL
                '-------------------
                m_strLineItem = m_strLineItem & "^FO455,405^A0N,25,30^FWN^FH^FD" & m_strURL & "^FS" & vbCrLf
                 
                        '-------
                        'If logo
                        '-------
                        If m_strLogo = "0" Then
                             m_strLineItem = m_strLineItem & "^FO435,50^XGE:LOGO1.PCX,1,1^FS" & vbCrLf
                        '----------
                        'If NO logo
                        '----------
                        Else
                            m_strLineItem = m_strLineItem
                        End If
                        
                        '-----------
                        'Ref Options
                        '-----------
                        Select Case m_strRefOptions
                            '-------
                            '4 ref's
                            '-------
                            Case 0
                                Select Case m_strRefFormat
                                    '-------------------
                                    'human readable only
                                    '-------------------
                                    Case 0
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,15^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,40^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,105^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,130^AdN,30,10^FWN^FH^FD" & m_strRef2 & "^FS" & vbCrLf
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,195^A0N,30,30^FWN^FH^FD" & m_strRef3Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,220^AdN,30,10^FWN^FH^FD" & m_strRef3 & "^FS" & vbCrLf
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,285^A0N,30,30^FWN^FH^FD" & m_strRef4Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,310^AdN,30,10^FWN^FH^FD" & m_strRef4 & "^FS" & vbCrLf
                                    '------------
                                    'Barcode only
                                    '------------
                                    Case 1
                                    
                                        m_strLineItem = m_strLineItem & "^FO25,15^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                        If Trim(m_strRef1) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,40^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                                        End If
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,105^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                        If Trim(m_strRef2) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,130^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef2 & "^FS" & vbCrLf
                                        End If
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,195^A0N,30,30^FWN^FH^FD" & m_strRef3Cap & "^FS" & vbCrLf
                                        If Trim(m_strRef3) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,220^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef3 & "^FS" & vbCrLf
                                        End If
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,285^A0N,30,30^FWN^FH^FD" & m_strRef4Cap & "^FS" & vbCrLf
                                        If Trim(m_strRef4) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,310^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef4 & "^FS" & vbCrLf
                                        End If
                                    '---------------------
                                    'BARCODES AND READABLE
                                    '---------------------
                                    Case 2
                                        m_strLineItem = m_strLineItem & "^FO25,10^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,35^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                                        If Trim(m_strRef1) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,65^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                                        End If
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,115^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,140^AdN,30,10^FWN^FH^FD" & m_strRef2 & "^FS" & vbCrLf
                                        If Trim(m_strRef2) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,170^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef2 & "^FS" & vbCrLf
                                        End If
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,220^A0N,30,30^FWN^FH^FD" & m_strRef3Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,245^AdN,30,10^FWN^FH^FD" & m_strRef3 & "^FS" & vbCrLf
                                        If Trim(m_strRef3) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,275^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef3 & "^FS" & vbCrLf
                                        End If
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,325^A0N,30,30^FWN^FH^FD" & m_strRef4Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,350^AdN,30,10^FWN^FH^FD" & m_strRef4 & "^FS" & vbCrLf
                                        If Trim(m_strRef4) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,377^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef4 & "^FS" & vbCrLf
                                        End If
                                    Case Else
                                 End Select
                            '-----------------
                            '2 ref's & message
                            '-----------------
                            Case 1
                                Select Case m_strRefFormat
                                    '--------------
                                    'human readable
                                    '--------------
                                    Case 0
                                        m_strLineItem = m_strLineItem & "^FO25,15^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,40^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,105^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,130^AdN,30,10^FWN^FH^FD" & m_strRef2 & "^FS" & vbCrLf
                                        '-------------
                                        'message field
                                        '-------------
                                        m_strLineItem = m_strLineItem & "^FO25,185^A0N,30,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,215^AdN,20,10^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,235^AdN,20,10^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,255^AdN,20,10^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,275^AdN,20,10^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,295^AdN,20,10^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,315^AdN,20,10^FWN^FH^FD" & strMsgLine6 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,335^AdN,20,10^FWN^FH^FD" & strMsgLine7 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,355^AdN,20,10^FWN^FH^FD" & strMsgLine8 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,375^AdN,20,10^FWN^FH^FD" & strMsgLine9 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,395^AdN,20,10^FWN^FH^FD" & strMsgLine10 & "^FS" & vbCrLf
                                        
                                    '------------
                                    'barcode only
                                    '------------
                                    Case 1
                                        m_strLineItem = m_strLineItem & "^FO25,15^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                        If Trim(m_strRef1) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,40^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                                        End If
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,105^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                        If Trim(m_strRef2) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,130^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef2 & "^FS" & vbCrLf
                                        End If
                                        '-------------
                                        'message field
                                        '-------------
                                        m_strLineItem = m_strLineItem & "^FO25,185^A0N,30,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,215^AdN,20,10^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,235^AdN,20,10^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,255^AdN,20,10^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,275^AdN,20,10^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,295^AdN,20,10^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,315^AdN,20,10^FWN^FH^FD" & strMsgLine6 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,335^AdN,20,10^FWN^FH^FD" & strMsgLine7 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,355^AdN,20,10^FWN^FH^FD" & strMsgLine8 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,375^AdN,20,10^FWN^FH^FD" & strMsgLine9 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,395^AdN,20,10^FWN^FH^FD" & strMsgLine10 & "^FS" & vbCrLf
                                    '------------------------
                                    'Human readable & barcode
                                    '------------------------
                                    Case 2
                                        m_strLineItem = m_strLineItem & "^FO25,10^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,35^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                                        If Trim(m_strRef1) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,65^BY1,1,0^BCN,30,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                                        End If
                                        
                                        m_strLineItem = m_strLineItem & "^FO25,95^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,120^AdN,30,10^FWN^FH^FD" & m_strRef2 & "^FS" & vbCrLf
                                        If Trim(m_strRef2) <> "" Then
                                            m_strLineItem = m_strLineItem & "^FO25,150^BY1,1,0^BCN,30,N,N,N,N^FWN^FD" & m_strRef2 & "^FS" & vbCrLf
                                        End If
                                        '-------------
                                        'message field
                                        '-------------
                                        m_strLineItem = m_strLineItem & "^FO25,185^A0N,30,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,215^AdN,20,10^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,235^AdN,20,10^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,255^AdN,20,10^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,275^AdN,20,10^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,295^AdN,20,10^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,315^AdN,20,10^FWN^FH^FD" & strMsgLine6 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,335^AdN,20,10^FWN^FH^FD" & strMsgLine7 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,355^AdN,20,10^FWN^FH^FD" & strMsgLine8 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,375^AdN,20,10^FWN^FH^FD" & strMsgLine9 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,395^AdN,20,10^FWN^FH^FD" & strMsgLine10 & "^FS" & vbCrLf
                                    Case Else
                                 End Select
                            '------------
                            'message only
                            '------------
                            Case 2
                                '-----------------------------------------------------
                                'if no logo and message only, use whole width of label
                                '-----------------------------------------------------
                                If m_strLogo = "0" Then
                                        m_strLineItem = m_strLineItem & "^FO25,145^A0N,30,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,175^AdN,20,10^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,195^AdN,20,10^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,215^AdN,20,10^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,235^AdN,20,10^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,255^AdN,20,10^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,275^AdN,20,10^FWN^FH^FD" & strMsgLine6 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,295^AdN,20,10^FWN^FH^FD" & strMsgLine7 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,315^AdN,20,10^FWN^FH^FD" & strMsgLine8 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,335^AdN,20,10^FWN^FH^FD" & strMsgLine9 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO25,355^AdN,20,10^FWN^FH^FD" & strMsgLine10 & "^FS" & vbCrLf
                                '------------
                                'message only
                                '------------
                                Else
                                        m_strLineItem = m_strLineItem & "^FO75,50^A0N,40,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO75,100^A0N,30,20^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO75,130^A0N,30,20^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO75,160^A0N,30,20^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO75,190^A0N,30,20^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                        m_strLineItem = m_strLineItem & "^FO75,220^A0N,30,20^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                                End If
                            Case Else
                        End Select
            Case "1"
                '------------------------------------------------------------------------------------
                'The below code prints a pick ticket on the 2" space above the FedEx Common Label
                'on 8" label stock.  See the UserDefinedType (PickTicketValues) in modLabel8 (dec's).
                '------------------------------------------------------------------------------------
                With m_udtPickTicket
                    '-----
                    'Ref's
                    '-----
                    m_strLineItem = m_strLineItem & "^FO10,15^A0N,30,30^FWN^FH^FD" & .BatchIdCap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,15^A0N,30,30^FWN^FH^FD" & .BatchId & "^FS" & vbCrLf
        
                    m_strLineItem = m_strLineItem & "^FO10,40^A0N,30,30^FWN^FH^FD" & .PicRef1Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,40^A0N,30,30^FWN^FH^FD" & .PicRef1 & "^FS" & vbCrLf
        
                    m_strLineItem = m_strLineItem & "^FO10,65^A0N,30,30^FWN^FH^FD" & .PicRef2Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,65^A0N,30,30^FWN^FH^FD" & .PicRef2 & "^FS" & vbCrLf
    
                    m_strLineItem = m_strLineItem & "^FO10,90^A0N,30,30^FWN^FH^FD" & .PicRef3Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,90^A0N,30,30^FWN^FH^FD" & .PicRef3 & "^FS" & vbCrLf
    
                    m_strLineItem = m_strLineItem & "^FO10,115^A0N,30,30^FWN^FH^FD" & .PicRef4Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,115^A0N,30,30^FWN^FH^FD" & .PicRef4 & "^FS" & vbCrLf
                   '-----------
                   'COL HEADERS
                   '-----------
                    m_strLineItem = m_strLineItem & "^FO60,150^A0N,30,30^FWN^FH^FD" & .ColHeader1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,150^A0N,30,30^FWN^FH^FD" & .ColHeader2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,150^A0N,30,30^FWN^FH^FD" & .ColHeader3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,150^A0N,30,30^FWN^FH^FD" & .ColHeader4 & "^FS" & vbCrLf
                    '----
                    'row1
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,175^AdN,0,0^FWN^FH^FD" & .Row01Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,175^AdN,0,0^FWN^FH^FD" & .Row01Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,175^AdN,0,0^FWN^FH^FD" & .Row01Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,175^AdN,0,0^FWN^FH^FD" & .Row01Col4 & "^FS" & vbCrLf
                    '----
                    'row2
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,195^AdN,0,0^FWN^FH^FD" & .Row02Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,195^AdN,0,0^FWN^FH^FD" & .Row02Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,195^AdN,0,0^FWN^FH^FD" & .Row02Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,195^AdN,0,0^FWN^FH^FD" & .Row02Col4 & "^FS" & vbCrLf
                    '----
                    'row3
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,215^AdN,0,0^FWN^FH^FD" & .Row03Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,215^AdN,0,0^FWN^FH^FD" & .Row03Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,215^AdN,0,0^FWN^FH^FD" & .Row03Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,215^AdN,0,0^FWN^FH^FD" & .Row03Col4 & "^FS" & vbCrLf
                    '----
                    'row4
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,235^AdN,0,0^FWN^FH^FD" & .Row04Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,235^AdN,0,0^FWN^FH^FD" & .Row04Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,235^AdN,0,0^FWN^FH^FD" & .Row04Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,235^AdN,0,0^FWN^FH^FD" & .Row04Col4 & "^FS" & vbCrLf
                    '----
                    'row5
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,255^AdN,0,0^FWN^FH^FD" & .Row05Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,255^AdN,0,0^FWN^FH^FD" & .Row05Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,255^AdN,0,0^FWN^FH^FD" & .Row05Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,255^AdN,0,0^FWN^FH^FD" & .Row05Col4 & "^FS" & vbCrLf
                    '----
                    'row6
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,275^AdN,0,0^FWN^FH^FD" & .Row06Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,275^AdN,0,0^FWN^FH^FD" & .Row06Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,275^AdN,0,0^FWN^FH^FD" & .Row06Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,275^AdN,0,0^FWN^FH^FD" & .Row06Col4 & "^FS" & vbCrLf
                    '----
                    'row7
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,295^AdN,0,0^FWN^FH^FD" & .Row07Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,295^AdN,0,0^FWN^FH^FD" & .Row07Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,295^AdN,0,0^FWN^FH^FD" & .Row07Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,295^AdN,0,0^FWN^FH^FD" & .Row07Col4 & "^FS" & vbCrLf
                    '----
                    'row8
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,315^AdN,0,0^FWN^FH^FD" & .Row08Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,315^AdN,0,0^FWN^FH^FD" & .Row08Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,315^AdN,0,0^FWN^FH^FD" & .Row08Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,315^AdN,0,0^FWN^FH^FD" & .Row08Col4 & "^FS" & vbCrLf
                    '----
                    'row9
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,335^AdN,0,0^FWN^FH^FD" & .Row09Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,335^AdN,0,0^FWN^FH^FD" & .Row09Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,335^AdN,0,0^FWN^FH^FD" & .Row09Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,335^AdN,0,0^FWN^FH^FD" & .Row09Col4 & "^FS" & vbCrLf
                    '-----
                    'row10
                    '-----
                    m_strLineItem = m_strLineItem & "^FO60,355^AdN,0,0^FWN^FH^FD" & .Row10Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,355^AdN,0,0^FWN^FH^FD" & .Row10Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,355^AdN,0,0^FWN^FH^FD" & .Row10Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,355^AdN,0,0^FWN^FH^FD" & .Row10Col4 & "^FS" & vbCrLf
                    '---------------
                    'Footer captions
                    '---------------
                    m_strLineItem = m_strLineItem & "^FO10,390^A0N,30,30^FWN^FH^FD" & .TicketFooter1Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO250,390^A0N,30,30^FWN^FH^FD" & .TicketFooter2Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,390^A0N,30,30^FWN^FH^FD" & .TicketFooter3Cap & "^FS" & vbCrLf
                    '-------
                    'Footers
                    '-------
                    m_strLineItem = m_strLineItem & "^FO140,395^AdN,0,0^FWN^FH^FD" & .TicketFooter1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO380,395^AdN,0,0^FWN^FH^FD" & .TicketFooter2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO635,395^AdN,0,0^FWN^FH^FD" & .TicketFooter3 & "^FS" & vbCrLf
                    
                End With
            '-------
            'sort id
            '-------
            Case "2"
                '-------------------------------------------------------
                'Depending on fonts size selected, print sort id feature
                '-------------------------------------------------------
                If Trim(m_strSortIdFontSize) = "0" Then
                    m_strSortID = Left(Trim(m_strSortID), 5)
                    m_strLineItem = m_strLineItem & "^FO10,20^A0N,500,325^FWN^FH^FD" & m_strSortID & "^FS" & vbCrLf
                ElseIf Trim(m_strSortIdFontSize) = "1" Then
                    m_strSortID = Left(Trim(m_strSortID), 12)
                    m_strLineItem = m_strLineItem & "^FO20,20^A0N,250,125^FWN^FH^FD" & m_strSortID & "^FS" & vbCrLf
                Else
                    'do nothing
                End If
            '------
            'sscc18
            '------
            Case "3"
                '-------
                'Barcode
                '-------
                m_strLineItem = m_strLineItem & "^FO150,100^BY3^BCN,210,N,N,N,U^FD" & m_strSSCC18 & "^FS" & vbCrLf
                '---------------------------------------------------
                'Human readable broken out to look industry standard
                '---------------------------------------------------
                m_strLineItem = m_strLineItem & "^FO150,320^A0N,25,30^FWN^FH^FD" & "(" & Left(m_strSSCC18, 2) & _
                ")" & Space(2) & Mid(m_strSSCC18, 3, 18) & "^FS" & vbCrLf
            '-----------------
            'Bed Bath & Beyond
            '-----------------
            Case "4"
                With m_udtBedBathBeyond
                    '--------------
                    'sscc18 Barcode
                    '--------------
                    m_strLineItem = m_strLineItem & "^FO150,160^BY3^BCN,210,N,N,N,U^FD" & .SSCC18 & "^FS" & vbCrLf
                    '--------------
                    'Human Readable
                    '--------------
                    m_strLineItem = m_strLineItem & "^FO150,380^AdN,30,10^FWN^FH^FD" & "SSCC18 - " & "(" & Left(.SSCC18, 2) & _
                    ")" & Space(2) & Mid(.SSCC18, 3, 18) & "^FS" & vbCrLf
                    '---------
                    'Po Number
                    '---------
                    m_strLineItem = m_strLineItem & "^FO25,20^A0N,30,30^FWN^FH^FD" & "PO #:" & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO100,20^A0N,75,75^FWN^FH^FD" & .PoNumber & "^FS" & vbCrLf
                    '------------
                    'Store Number
                    '------------
                    m_strLineItem = m_strLineItem & "^FO215,90^A0N,30,30^FWN^FH^FD" & "Store #:" & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO340,90^A0N,75,75^FWN^FH^FD" & .StoreNumber & "^FS" & vbCrLf
                    '-------------
                    'Vendor Number
                    '-------------
                    m_strLineItem = m_strLineItem & "^FO415,20^A0N,30,30^FWN^FH^FD" & "Vendor #:" & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO555,20^A0N,75,75^FWN^FH^FD" & .VendorNumber & "^FS" & vbCrLf
                    
                End With
            '------
            'signature required
            '------
            Case "5"
                If Cafe1.SignatureRequiredStyle = 1 Then
                    m_strLineItem = m_strLineItem & "^FO30,20^GB730,10,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO30,20^GB10,370,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO755,20^GB10,370,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO30,385^GB735,10,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,40^GB680,58,58^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,50^A0N,50,60^FR^FWN^FD   SIGNATURE REQUIRED  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,135^A0N,35,30^FWN^FH^FDDELIVER TO CONSIGNEE'S ADDRESS ONLY^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,175^A0N,35,28^FWN^FH^FD  * No Indirect Delivery^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,215^A0N,35,28^FWN^FH^FD  * No Delivery Release Signature^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,285^A0N,35,30^FWN^FH^FDLIVRER UNIQUEMENT A L'ADRESSE DU DESTINATAIRE^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,325^A0N,35,28^FWN^FH^FD  * Aucune livraison indirecte ni signature de decharge^FS" & vbCrLf
                ElseIf Cafe1.SignatureRequiredStyle = 2 Then
                    m_strLineItem = m_strLineItem & "^FO30,20^GB730,10,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO30,20^GB10,380,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO755,20^GB10,380,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO30,395^GB735,10,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,40^GB680,54,54^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,50^A0N,45,50^FR^FWN^FD      Attention FedEx Courier:  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,90^GB680,52,52^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,100^A0N,45,50^FR^FWN^FD       SIGNATURE REQUIRED  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,155^A0N,35,28^FWN^FH^FD                  This package cannot be released  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,185^A0N,35,28^FWN^FH^FD                    without obtaining a signature.  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,240^GB680,54,54^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,250^A0N,45,50^FR^FWN^FD     Attention messager FedEx:  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,290^GB680,52,52^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,300^A0N,45,50^FR^FWN^FD     SIGNATURE OBLIGATOIRE  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,355^A0N,35,28^FWN^FH^FD           Cet envoi ne peut etre laisse sans signature. ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,385^A0N,35,28^FWN^FH^FD              ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "LO10,425,790,2" & vbCrLf
                End If
            '------
            'FedEx Canada custom bar code
            '------
            Case "6"
                ' Nothing to do here
                    
            Case Else
                MsgBox "Label feature set not defined", vbExclamation Or vbSystemModal, "Error"
        End Select
                
    Exit Sub
    
EH:
  MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
  Or vbSystemModal, "modLabel8.ZplDocTabNo"
                        
End Sub

Private Sub ZplDocTabYES()
'--------------------------------------------------------------------------------
'Author: Domonic Grande emp 396671
'Called from: modLabel8.ZplChangeLabel
'Purpose: This sub takes the settins provided by frmConfigLabel (held in the reg)
'         and adds ZPL code to the label buffer
'--------------------------------------------------------------------------------
        On Error GoTo EH
        
        Dim lngX As Long
        Dim lngY As Long
        
        '-----------------------
        'Writes comment into zpl
        '-----------------------
        m_strLineItem = vbCrLf & "^FX **********CUSTOM LABEL BELOW********** FS^" & vbCrLf
        '-----------------------------------------
        'Draws line between FedEx label and custom
        '-----------------------------------------
        ' 2009-07-21, JFW
        ' 2010-12-29, JFW, Line not necessary for Sig Reqd label
        If m_strLabelFeatureSet <> "6" And m_strLabelFeatureSet <> "5" Then
            m_strLineItem = m_strLineItem & "^FO10,605^GB790,2,2^FS" & vbCrLf
        End If
        
        '----------------
        'If No pickTicket
        '----------------
        Select Case m_strLabelFeatureSet
            Case "0"
                '--------------------------------
                'Holds 30 char line out of messge
                '--------------------------------
                Dim strMessageLine As String
                '---------------------------------------------------------------------------------------------
                'Holds the complete message broken into 5 or 10 lines (depending on len with "^" between lines
                '---------------------------------------------------------------------------------------------
                Dim strParseMessage As String
                '---------------------------------------------------
                'Tells how long to print the message line (30 or 60)
                '---------------------------------------------------
                Dim intLineLen As Integer
                '------------------------------
                'Trim message down to 300 chars
                '------------------------------
                m_strMessage = Left(Trim(m_strMessage), 300)
                '-------------------------------------------
                'Need a var in current scope to check status
                '-------------------------------------------
                Dim strCompleteText As String
                strCompleteText = m_strMessage
                '-----------------------------------------------------------------
                'strCompleteText will start off with the entire message then after
                'the function call it will be stripped of the chars printed line
                'by line until the loop is exited.
                '-----------------------------------------------------------------
                Do Until strCompleteText = ""
                    '---------------------------------------------------------------
                    'Check to see which features are being used.  If logo or other
                    'refs are being used, set the len for the message lines to print
                    '---------------------------------------------------------------
                    If Trim(m_strLogo) = "0" Or Trim(m_strRefOptions) = "1" Then
                        intLineLen = 30
                    ElseIf Trim(m_strLogo) = "1" Or Trim(m_strRefOptions) = "2" Then
                        intLineLen = 60
                    Else
                        intLineLen = 30
                    End If
                    ' 2007-11-09, JFW, I should get 60 char line, but logic above somehow goes 30
                    intLineLen = 60
                        '------------------------------------------------------------
                        'Call function to break message up into lines (len) depending
                        'on other features used
                        '------------------------------------------------------------
                        strMessageLine = modLabel8.WordWrap(strCompleteText, intLineLen)
                        '-------------------------------------------------------------
                        'Container to hold the message with a "^" between lines.  It's
                        'parsed below so each line can be printed separate.
                        '-------------------------------------------------------------
                        If Trim(strParseMessage) = "" Then
                            strParseMessage = strMessageLine
                        Else
                            strParseMessage = strParseMessage & "^" & strMessageLine
                        End If
                Loop
                
                '------------------------
                'Split message out by "^"
                '------------------------
                Dim vrtMessageArray As Variant
                vrtMessageArray = Split(strParseMessage, "^")
                '-----------------------------------------
                'use ubound to see when data can be mapped
                '-----------------------------------------
                Dim intMessageCount As Integer
                intMessageCount = UBound(vrtMessageArray)
                '-----------------------------------------------
                'Parsing the message field into (up to) 10 lines
                '-----------------------------------------------
                If intMessageCount >= 0 Then
                    Dim strMsgLine1 As String
                    strMsgLine1 = vrtMessageArray(0)
                End If
                If intMessageCount >= 1 Then
                    Dim strMsgLine2 As String
                    strMsgLine2 = vrtMessageArray(1)
                End If
                If intMessageCount >= 2 Then
                    Dim strMsgLine3 As String
                    strMsgLine3 = vrtMessageArray(2)
                End If
                If intMessageCount >= 3 Then
                    Dim strMsgLine4 As String
                    strMsgLine4 = vrtMessageArray(3)
                End If
                If intMessageCount >= 4 Then
                    Dim strMsgLine5 As String
                    strMsgLine5 = vrtMessageArray(4)
                End If
                If intMessageCount >= 5 Then
                    Dim strMsgLine6 As String
                    strMsgLine6 = vrtMessageArray(5)
                End If
                If intMessageCount >= 6 Then
                    Dim strMsgLine7 As String
                    strMsgLine7 = vrtMessageArray(6)
                End If
                If intMessageCount >= 7 Then
                    Dim strMsgLine8 As String
                    strMsgLine8 = vrtMessageArray(7)
                End If
                If intMessageCount >= 8 Then
                    Dim strMsgLine9 As String
                    strMsgLine9 = vrtMessageArray(8)
                End If
                If intMessageCount >= 9 Then
                    Dim strMsgLine10 As String
                    strMsgLine10 = vrtMessageArray(9)
                End If

                '-------------------
                'Writes customer URL
                '-------------------
                m_strLineItem = m_strLineItem & "^FO425,605^A0N,25,30^FWN^FH^FD" & m_strURL & "^FS" & vbCrLf
                '-------
                'If logo
                '-------
                If m_strLogo = "0" Then
                     m_strLineItem = m_strLineItem & "^FO435,250^XGE:LOGO1.PCX,1,1^FS" & vbCrLf
                '----------
                'If NO logo
                '----------
                Else
                    m_strLineItem = m_strLineItem
                End If
            
                Select Case m_strRefOptions
                    '-----------
                    'Ref Options
                    '-----------
                    Case 0
                        Select Case m_strRefFormat
                            Case 0
                                '-------------------
                                'human readable only
                                '-------------------
                                m_strLineItem = m_strLineItem & "^FO25,215^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,240^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                                
                                m_strLineItem = m_strLineItem & "^FO25,305^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,330^AdN,30,10^FWN^FH^FD" & m_strRef2 & "^FS" & vbCrLf
                                
                                m_strLineItem = m_strLineItem & "^FO25,395^A0N,30,30^FWN^FH^FD" & m_strRef3Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,420^AdN,30,10^FWN^FH^FD" & m_strRef3 & "^FS" & vbCrLf
                                
                                m_strLineItem = m_strLineItem & "^FO25,485^A0N,30,30^FWN^FH^FD" & m_strRef4Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,510^AdN,30,10^FWN^FH^FD" & m_strRef4 & "^FS" & vbCrLf
                            Case 1
                                '---------------------------------------------------------------------------------------------
                                'Barcode only.  Barcode will print begining and ending even if no data.  Validate before print
                                '---------------------------------------------------------------------------------------------
                                m_strLineItem = m_strLineItem & "^FO25,215^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                If Trim(m_strRef1) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,240^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                                End If
                                
                                m_strLineItem = m_strLineItem & "^FO25,305^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                If Trim(m_strRef2) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,330^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef2 & "^FS" & vbCrLf
                                End If
                                
                                m_strLineItem = m_strLineItem & "^FO25,395^A0N,30,30^FWN^FH^FD" & m_strRef3Cap & "^FS" & vbCrLf
                                If Trim(m_strRef3) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,420^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef3 & "^FS" & vbCrLf
                                End If
                                
                                m_strLineItem = m_strLineItem & "^FO25,485^A0N,30,30^FWN^FH^FD" & m_strRef4Cap & "^FS" & vbCrLf
                                If Trim(m_strRef4) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,510^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef4 & "^FS" & vbCrLf
                                End If
                            Case 2
                                '---------------------
                                'BARCODES AND READABLE
                                '---------------------
                                m_strLineItem = m_strLineItem & "^FO25,212^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,237^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                                If Trim(m_strRef1) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,267^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                                End If
                                
                                m_strLineItem = m_strLineItem & "^FO25,315^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,340^AdN,30,10^FWN^FH^FD" & m_strRef2 & "^FS" & vbCrLf
                                If Trim(m_strRef2) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,370^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef2 & "^FS" & vbCrLf
                                End If
                                
                                m_strLineItem = m_strLineItem & "^FO25,420^A0N,30,30^FWN^FH^FD" & m_strRef3Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,445^AdN,30,10^FWN^FH^FD" & m_strRef3 & "^FS" & vbCrLf
                                If Trim(m_strRef3) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,475^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef3 & "^FS" & vbCrLf
                                End If
                                
                                m_strLineItem = m_strLineItem & "^FO25,525^A0N,30,30^FWN^FH^FD" & m_strRef4Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,550^AdN,30,10^FWN^FH^FD" & m_strRef4 & "^FS" & vbCrLf
                                If Trim(m_strRef4) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,577^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef4 & "^FS" & vbCrLf
                                End If
                            Case Else
                         End Select
                    '-----------------
                    '2 ref's & message
                    '-----------------
                    Case 1
                                                                
                        Select Case m_strRefFormat
                            '---------------
                            'Format to print
                            '---------------
                            Case 0
                                m_strLineItem = m_strLineItem & "^FO25,215^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,240^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                                
                                m_strLineItem = m_strLineItem & "^FO25,275^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,300^AdN,30,10^FWN^FH^FD" & m_strRef2 & "^FS" & vbCrLf
                                '-------------
                                'message field
                                '-------------
                                m_strLineItem = m_strLineItem & "^FO25,345^A0N,30,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,375^AdN,20,10^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,395^AdN,20,10^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,415^AdN,20,10^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,435^AdN,20,10^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,455^AdN,20,10^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,475^AdN,20,10^FWN^FH^FD" & strMsgLine6 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,495^AdN,20,10^FWN^FH^FD" & strMsgLine7 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,515^AdN,20,10^FWN^FH^FD" & strMsgLine8 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,535^AdN,20,10^FWN^FH^FD" & strMsgLine9 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,555^AdN,20,10^FWN^FH^FD" & strMsgLine10 & "^FS" & vbCrLf
                                
                            Case 1
                                '------------
                                'barcode only
                                '------------
                                m_strLineItem = m_strLineItem & "^FO25,215^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                If Trim(m_strRef1) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,240^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                                End If
                                
                                m_strLineItem = m_strLineItem & "^FO25,295^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                If Trim(m_strRef2) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,320^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef2 & "^FS" & vbCrLf
                                End If
                                '-------------
                                'message field
                                '-------------
                                m_strLineItem = m_strLineItem & "^FO25,395^A0N,30,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,425^AdN,20,10^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,445^AdN,20,10^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,465^AdN,20,10^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,485^AdN,20,10^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,505^AdN,20,10^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,525^AdN,20,10^FWN^FH^FD" & strMsgLine6 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,545^AdN,20,10^FWN^FH^FD" & strMsgLine7 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,565^AdN,20,10^FWN^FH^FD" & strMsgLine8 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,585^AdN,20,10^FWN^FH^FD" & strMsgLine9 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,605^AdN,20,10^FWN^FH^FD" & strMsgLine10 & "^FS" & vbCrLf
                            Case 2
                                '------------------------
                                'Human readable & barcode
                                '------------------------
                                m_strLineItem = m_strLineItem & "^FO25,210^A0N,30,30^FWN^FH^FD" & m_strRef1Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,235^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                                If Trim(m_strRef1) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,265^BY1,1,0^BCN,30,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                                End If
                                
                                m_strLineItem = m_strLineItem & "^FO25,305^A0N,30,30^FWN^FH^FD" & m_strRef2Cap & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,330^AdN,30,10^FWN^FH^FD" & m_strRef2 & "^FS" & vbCrLf
                                If Trim(m_strRef2) <> "" Then
                                    m_strLineItem = m_strLineItem & "^FO25,360^BY1,1,0^BCN,30,N,N,N,N^FWN^FD" & m_strRef2 & "^FS" & vbCrLf
                                End If
                                '-------------
                                'message field
                                '-------------
                                m_strLineItem = m_strLineItem & "^FO25,395^A0N,30,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,425^AdN,20,10^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,445^AdN,20,10^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,465^AdN,20,10^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,485^AdN,20,10^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,505^AdN,20,10^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,525^AdN,20,10^FWN^FH^FD" & strMsgLine6 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,545^AdN,20,10^FWN^FH^FD" & strMsgLine7 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,565^AdN,20,10^FWN^FH^FD" & strMsgLine8 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,585^AdN,20,10^FWN^FH^FD" & strMsgLine9 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,605^AdN,20,10^FWN^FH^FD" & strMsgLine10 & "^FS" & vbCrLf
                            Case Else
                         End Select
                    '------------
                    'message only
                    '------------
                    Case 2
                        '-----------------------------------------------------
                        'if no logo and message only, use whole width of label
                        '-----------------------------------------------------
                        If m_strLogo = "0" Then
                                m_strLineItem = m_strLineItem & "^FO25,345^A0N,30,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,375^AdN,20,10^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,395^AdN,20,10^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,415^AdN,20,10^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,435^AdN,20,10^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,455^AdN,20,10^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,475^AdN,20,10^FWN^FH^FD" & strMsgLine6 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,495^AdN,20,10^FWN^FH^FD" & strMsgLine7 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,515^AdN,20,10^FWN^FH^FD" & strMsgLine8 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,535^AdN,20,10^FWN^FH^FD" & strMsgLine9 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO25,555^AdN,20,10^FWN^FH^FD" & strMsgLine10 & "^FS" & vbCrLf
                        '------------
                        'message only
                        '------------
                        Else
                                m_strLineItem = m_strLineItem & "^FO75,325^A0N,40,30^FWN^FH^FD" & m_strMessageCaption & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO75,375^A0N,30,20^FWN^FH^FD" & strMsgLine1 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO75,415^A0N,30,20^FWN^FH^FD" & strMsgLine2 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO75,455^A0N,30,20^FWN^FH^FD" & strMsgLine3 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO75,495^A0N,30,20^FWN^FH^FD" & strMsgLine4 & "^FS" & vbCrLf
                                m_strLineItem = m_strLineItem & "^FO75,535^A0N,30,20^FWN^FH^FD" & strMsgLine5 & "^FS" & vbCrLf
                        End If
                    Case Else
                End Select
        
        
            '----------------
            'PICK TICKET CODE
            '----------------
            Case "1"
                '------------------------------------------------------------------------------------
                'The below code prints a pick ticket on the 2" space above the FedEx Common Label
                'on 8" label stock.  See the UserDefinedType (PickTicketValues) in modLabel8 (dec's).
                '------------------------------------------------------------------------------------
                With m_udtPickTicket
                    '----------
                    'ref fields
                    '----------
                    m_strLineItem = m_strLineItem & "^FO10,220^A0N,30,30^FWN^FH^FD" & .BatchIdCap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,220^A0N,30,30^FWN^FH^FD" & .BatchId & "^FS" & vbCrLf
        
                    m_strLineItem = m_strLineItem & "^FO10,245^A0N,30,30^FWN^FH^FD" & .PicRef1Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,245^A0N,30,30^FWN^FH^FD" & .PicRef1 & "^FS" & vbCrLf
        
                    m_strLineItem = m_strLineItem & "^FO10,270^A0N,30,30^FWN^FH^FD" & .PicRef2Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,270^A0N,30,30^FWN^FH^FD" & .PicRef2 & "^FS" & vbCrLf
                    
                    m_strLineItem = m_strLineItem & "^FO10,295^A0N,30,30^FWN^FH^FD" & .PicRef3Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,295^A0N,30,30^FWN^FH^FD" & .PicRef3 & "^FS" & vbCrLf
                    
                    m_strLineItem = m_strLineItem & "^FO10,320^A0N,30,30^FWN^FH^FD" & .PicRef4Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO170,320^A0N,30,30^FWN^FH^FD" & .PicRef4 & "^FS" & vbCrLf
                   '-----------
                   'COL HEADERS
                   '-----------
                    m_strLineItem = m_strLineItem & "^FO60,355^A0N,30,30^FWN^FH^FD" & .ColHeader1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,355^A0N,30,30^FWN^FH^FD" & .ColHeader2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,355^A0N,30,30^FWN^FH^FD" & .ColHeader3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,355^A0N,30,30^FWN^FH^FD" & .ColHeader4 & "^FS" & vbCrLf
                    '----
                    'row1
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,380^AdN,0,0^FWN^FH^FD" & .Row01Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,380^AdN,0,0^FWN^FH^FD" & .Row01Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,380^AdN,0,0^FWN^FH^FD" & .Row01Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,380^AdN,0,0^FWN^FH^FD" & .Row01Col4 & "^FS" & vbCrLf
                    '----
                    'row2
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,400^AdN,0,0^FWN^FH^FD" & .Row02Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,400^AdN,0,0^FWN^FH^FD" & .Row02Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,400^AdN,0,0^FWN^FH^FD" & .Row02Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,400^AdN,0,0^FWN^FH^FD" & .Row02Col4 & "^FS" & vbCrLf
                    '----
                    'row3
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,420^AdN,0,0^FWN^FH^FD" & .Row03Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,420^AdN,0,0^FWN^FH^FD" & .Row03Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,420^AdN,0,0^FWN^FH^FD" & .Row03Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,420^AdN,0,0^FWN^FH^FD" & .Row03Col4 & "^FS" & vbCrLf
                    '----
                    'row4
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,440^AdN,0,0^FWN^FH^FD" & .Row04Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,440^AdN,0,0^FWN^FH^FD" & .Row04Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,440^AdN,0,0^FWN^FH^FD" & .Row04Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,440^AdN,0,0^FWN^FH^FD" & .Row04Col4 & "^FS" & vbCrLf
                    '----
                    'row5
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,460^AdN,0,0^FWN^FH^FD" & .Row05Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,460^AdN,0,0^FWN^FH^FD" & .Row05Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,460^AdN,0,0^FWN^FH^FD" & .Row05Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,460^AdN,0,0^FWN^FH^FD" & .Row05Col4 & "^FS" & vbCrLf
                    '----
                    'row6
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,480^AdN,0,0^FWN^FH^FD" & .Row06Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,480^AdN,0,0^FWN^FH^FD" & .Row06Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,480^AdN,0,0^FWN^FH^FD" & .Row06Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,480^AdN,0,0^FWN^FH^FD" & .Row06Col4 & "^FS" & vbCrLf
                    '----
                    'row7
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,500^AdN,0,0^FWN^FH^FD" & .Row07Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,500^AdN,0,0^FWN^FH^FD" & .Row07Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,500^AdN,0,0^FWN^FH^FD" & .Row07Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,500^AdN,0,0^FWN^FH^FD" & .Row07Col4 & "^FS" & vbCrLf
                    '----
                    'row8
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,520^AdN,0,0^FWN^FH^FD" & .Row08Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,520^AdN,0,0^FWN^FH^FD" & .Row08Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,520^AdN,0,0^FWN^FH^FD" & .Row08Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,520^AdN,0,0^FWN^FH^FD" & .Row08Col4 & "^FS" & vbCrLf
                    '----
                    'row9
                    '----
                    m_strLineItem = m_strLineItem & "^FO60,540^AdN,0,0^FWN^FH^FD" & .Row09Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,540^AdN,0,0^FWN^FH^FD" & .Row09Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,540^AdN,0,0^FWN^FH^FD" & .Row09Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,540^AdN,0,0^FWN^FH^FD" & .Row09Col4 & "^FS" & vbCrLf
                    '-----
                    'row10
                    '-----
                    m_strLineItem = m_strLineItem & "^FO60,560^AdN,0,0^FWN^FH^FD" & .Row10Col1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO300,560^AdN,0,0^FWN^FH^FD" & .Row10Col2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,560^AdN,0,0^FWN^FH^FD" & .Row10Col3 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO700,560^AdN,0,0^FWN^FH^FD" & .Row10Col4 & "^FS" & vbCrLf
                    '---------------
                    'Footer captions
                    '---------------
                    m_strLineItem = m_strLineItem & "^FO10,595^A0N,30,30^FWN^FH^FD" & .TicketFooter1Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO250,595^A0N,30,30^FWN^FH^FD" & .TicketFooter2Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO500,595^A0N,30,30^FWN^FH^FD" & .TicketFooter3Cap & "^FS" & vbCrLf
                    '-------
                    'Footers
                    '-------
                    m_strLineItem = m_strLineItem & "^FO140,600^AdN,0,0^FWN^FH^FD" & .TicketFooter1 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO380,600^AdN,0,0^FWN^FH^FD" & .TicketFooter2 & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO635,600^AdN,0,0^FWN^FH^FD" & .TicketFooter3 & "^FS" & vbCrLf
                    
                End With
            '-------
            'Sort id
            '-------
            Case "2"
                '-------------------------------------------------------
                'Depending on fonts size selected, print sort id feature
                '-------------------------------------------------------
                If Trim(m_strSortIdFontSize) = "0" Then
                    m_strSortID = Left(Trim(m_strSortID), 5)
                    m_strLineItem = m_strLineItem & "^FO10,225^A0N,500,325^FWN^FH^FD" & m_strSortID & "^FS" & vbCrLf
                ElseIf Trim(m_strSortIdFontSize) = "1" Then
                    m_strSortID = Left(Trim(m_strSortID), 12)
                    m_strLineItem = m_strLineItem & "^FO20,220^A0N,250,125^FWN^FH^FD" & m_strSortID & "^FS" & vbCrLf
                Else
                    'do nothing
                End If
            '------
            'sscc18
            '------
            Case "3"
                '-------
                'Barcode
                '-------
                m_strLineItem = m_strLineItem & "^FO150,300^BY3^BCN,210,N,N,N,U^FD" & m_strSSCC18 & "^FS" & vbCrLf
                '--------------------------------------------------
                'Human readable broken out to look industry standar
                '--------------------------------------------------
                m_strLineItem = m_strLineItem & "^FO150,520^A0N,25,30^FWN^FH^FD" & "(" & Left(m_strSSCC18, 2) & _
                ")" & Space(2) & Mid(m_strSSCC18, 3, 18) & "^FS" & vbCrLf
            '-----------------
            'Bed Bath & Beyond
            '-----------------
            Case "4"
                With m_udtBedBathBeyond
                    '--------------
                    'sscc18 Barcode
                    '--------------
                    m_strLineItem = m_strLineItem & "^FO150,360^BY3^BCN,210,N,N,N,U^FD" & .SSCC18 & "^FS" & vbCrLf
                    '--------------
                    'Human Readable
                    '--------------
                    m_strLineItem = m_strLineItem & "^FO150,580^AdN,30,10^FWN^FH^FD" & "SSCC18 - " & "(" & Left(.SSCC18, 2) & _
                    ")" & Space(2) & Mid(.SSCC18, 3, 18) & "^FS" & vbCrLf
                    '---------
                    'Po Number
                    '---------
                    m_strLineItem = m_strLineItem & "^FO25,220^A0N,30,30^FWN^FH^FD" & "PO #:" & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO100,220^A0N,75,75^FWN^FH^FD" & .PoNumber & "^FS" & vbCrLf
                    '------------
                    'Store Number
                    '------------
                    m_strLineItem = m_strLineItem & "^FO215,290^A0N,30,30^FWN^FH^FD" & "Store #:" & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO340,290^A0N,75,75^FWN^FH^FD" & .StoreNumber & "^FS" & vbCrLf
                    '-------------
                    'Vendor Number
                    '-------------
                    m_strLineItem = m_strLineItem & "^FO415,220^A0N,30,30^FWN^FH^FD" & "Vendor #:" & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO555,220^A0N,75,75^FWN^FH^FD" & .VendorNumber & "^FS" & vbCrLf
                    
                End With
            '------
            'signature required
            '------
            Case "5"
                If Cafe1.SignatureRequiredStyle = 1 Then
                    m_strLineItem = m_strLineItem & "^FO30,220^GB730,10,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO30,220^GB10,370,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO755,220^GB10,370,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO30,585^GB735,10,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,240^GB680,58,58^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,250^A0N,50,60^FR^FWN^FD   SIGNATURE REQUIRED  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,335^A0N,35,30^FWN^FH^FDDELIVER TO CONSIGNEE'S ADDRESS ONLY^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,375^A0N,35,28^FWN^FH^FD  * No Indirect Delivery^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,415^A0N,35,28^FWN^FH^FD  * No Delivery Release Signature^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,485^A0N,35,30^FWN^FH^FDLIVRER UNIQUEMENT A L'ADRESSE DU DESTINATAIRE^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,525^A0N,35,28^FWN^FH^FD  * Aucune livraison indirecte ni signature de decharge^FS" & vbCrLf
                ElseIf Cafe1.SignatureRequiredStyle = 2 Then
                    m_strLineItem = m_strLineItem & "^FO30,220^GB730,10,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO30,220^GB10,380,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO755,220^GB10,380,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO30,595^GB735,10,10^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,240^GB680,54,54^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,250^A0N,45,50^FR^FWN^FD      Attention FedEx Courier:  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,290^GB680,52,52^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,300^A0N,45,50^FR^FWN^FD       SIGNATURE REQUIRED  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,355^A0N,35,28^FWN^FH^FD                  This package cannot be released  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,385^A0N,35,28^FWN^FH^FD                    without obtaining a signature.  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,440^GB680,54,54^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,450^A0N,45,50^FR^FWN^FD     Attention messager FedEx:  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,490^GB680,52,52^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,500^A0N,45,50^FR^FWN^FD     SIGNATURE OBLIGATOIRE  ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,555^A0N,35,28^FWN^FH^FD           Cet envoi ne peut etre laisse sans signature. ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO60,585^A0N,35,28^FWN^FH^FD              ^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "LO10,625,790,2" & vbCrLf
                End If
                
            '------
            'FedEx Canada custom bar code
            '------
            Case "6"
                ' Nothing to do here
            
            Case Else
                MsgBox "Label feature set not defined", vbExclamation Or vbSystemModal, "Error"
        End Select
            '-------------
            'Doc tab setup
            '-------------
            Select Case m_strDocTabInfo
                Case 0
                    '--------------------------
                    'do nothing standard doctab
                    '--------------------------
                Case 1
                    '----------------------------
                    'CR: human readable & Barcode
                    '----------------------------
                    If m_strDocRef1Cap <> "" Then
                        m_strLineItem = m_strLineItem & "^FO15,10^A0N,30,30^FWN^FH^FD" & m_strDocRef1Cap & "^FS" & vbCrLf
                        m_strLineItem = m_strLineItem & "^FO150,10^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                        If Trim(m_strRef1) <> "" Then
                            m_strLineItem = m_strLineItem & "^FO150,40^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                        End If
                    Else
                        ' 2008-09-17, JFW, Barcode tracking number in the doctab for Meena
                        '-------------------------------
                        'Track: human readable & Barcode
                        '-------------------------------
                        If m_strDocRef2Cap <> "" Then
                            m_strLineItem = m_strLineItem & "^FO15,10^A0N,30,30^FWN^FH^FD" & m_strDocRef2Cap & "^FS" & vbCrLf
                        End If
                        If m_strIDMps = "Y" Then
                            '---------------------------------------------------------------------------------------------
                            'If idMps use tracking number pulled from print buffer in modLabel8.ChangeLabel.  Events don't
                            'match labels to pull from tbl or obj.
                            '---------------------------------------------------------------------------------------------
                            m_strLineItem = m_strLineItem & "^FO60,20^AdN,10,10^FWN^FH^FD" & m_strIdMpsTrack & "^FS" & vbCrLf
                            m_strLineItem = m_strLineItem & "^FO50,40^BY2,2,0^BCN,75,N,N,N,N^FWN^FD" & m_strIdMpsTrack & "^FS" & vbCrLf
                        Else
                            m_strLineItem = m_strLineItem & "^FO60,20^AdN,10,10^FWN^FH^FD" & m_strTrackingNumber & "^FS" & vbCrLf
                            m_strLineItem = m_strLineItem & "^FO50,40^BY2,2,0^BCN,75,N,N,N,N^FWN^FD" & m_strTrackingNumber & "^FS" & vbCrLf
                        End If
                    End If
                Case 2
                    '----------------------------
                    'CR: human readable & Barcode
                    '----------------------------
                    m_strLineItem = m_strLineItem & "^FO15,20^A0N,30,30^FWN^FH^FD" & m_strDocRef1Cap & "^FS" & vbCrLf
                    m_strLineItem = m_strLineItem & "^FO150,20^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                    If Trim(m_strRef1) <> "" Then
                        m_strLineItem = m_strLineItem & "^FO150,50^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                    End If
                    '-------------------------------
                    'Track: human readable & Barcode
                    '-------------------------------
                    If m_strIDMps = "Y" Then
                        '---------------------------------------------------------------------------------------------
                        'If idMps use tracking number pulled from print buffer in modLabel8.ChangeLabel.  Events don't
                        'match labels to pull from tbl or obj.
                        '---------------------------------------------------------------------------------------------
                        m_strLineItem = m_strLineItem & "^FO15,120^A0N,30,30^FWN^FH^FD" & m_strDocRef2Cap & "^FS" & vbCrLf
                        m_strLineItem = m_strLineItem & "^FO150,120^AdN,30,10^FWN^FH^FD" & m_strIdMpsTrack & "^FS" & vbCrLf
                        m_strLineItem = m_strLineItem & "^FO150,150^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strIdMpsTrack & "^FS" & vbCrLf
                    Else
                        m_strLineItem = m_strLineItem & "^FO15,120^A0N,30,30^FWN^FH^FD" & m_strDocRef2Cap & "^FS" & vbCrLf
                        m_strLineItem = m_strLineItem & "^FO150,120^AdN,30,10^FWN^FH^FD" & m_strTrackingNumber & "^FS" & vbCrLf
                        m_strLineItem = m_strLineItem & "^FO150,150^BY1,1,0^BCN,50,N,N,N,N^FWN^FD" & m_strTrackingNumber & "^FS" & vbCrLf
                    End If
                Case 3, 4
                    If m_strDocTabInfo = "3" Then
                        lngX = 15
                    Else
                        lngX = 250
                    End If
                    '----------------------------
                    'CR: human readable & Barcode
                    '----------------------------
                    If m_strDocRef1Cap <> "" And m_strRef1 <> "" Then
                        m_strLineItem = m_strLineItem & "^FO" & lngX & ",8^A0N,30,30^FWN^FH^FD" & m_strDocRef1Cap & "^FS" & vbCrLf
                        m_strLineItem = m_strLineItem & "^FO" & (lngX + 135) & ",8^AdN,30,10^FWN^FH^FD" & m_strRef1 & "^FS" & vbCrLf
                        If Trim(m_strRef1) <> "" Then
                            m_strLineItem = m_strLineItem & "^FO" & (lngX + 135) & ",43^BY2,2,0^BCN,30,N,N,N,N^FWN^FD" & m_strRef1 & "^FS" & vbCrLf
                        End If
                    End If
                    '-------------------------------
                    'Track: human readable & Barcode
                    '-------------------------------
                    If m_strDocRef2Cap <> "" Then
                        lngY = IIf(Trim(m_strLabelFeatureSet) = "6", 82, 120)
                        If m_strIDMps = "Y" Then
                            '---------------------------------------------------------------------------------------------
                            'If idMps use tracking number pulled from print buffer in modLabel8.ChangeLabel.  Events don't
                            'match labels to pull from tbl or obj.
                            '---------------------------------------------------------------------------------------------
                            m_strLineItem = m_strLineItem & "^FO" & lngX & "," & lngY & "^A0N,30,30^FWN^FH^FD" & m_strDocRef2Cap & "^FS" & vbCrLf
                            m_strLineItem = m_strLineItem & "^FO" & (lngX + 135) & "," & lngY & "^AdN,30,10^FWN^FH^FD" & m_strIdMpsTrack & "^FS" & vbCrLf
                            m_strLineItem = m_strLineItem & "^FO" & (lngX + 135) & "," & (lngY + 35) & "^BY2,2,0^BCN,30,N,N,N,N^FWN^FD" & m_strIdMpsTrack & "^FS" & vbCrLf
                        Else
                            m_strLineItem = m_strLineItem & "^FO" & lngX & "," & lngY & "^A0N,30,30^FWN^FH^FD" & m_strDocRef2Cap & "^FS" & vbCrLf
                            m_strLineItem = m_strLineItem & "^FO" & (lngX + 135) & "," & lngY & "^AdN,30,10^FWN^FH^FD" & m_strTrackingNumber & "^FS" & vbCrLf
                            m_strLineItem = m_strLineItem & "^FO" & (lngX + 135) & "," & (lngY + 35) & "^BY2,2,0^BCN,30,N,N,N,N^FWN^FD" & m_strTrackingNumber & "^FS" & vbCrLf
                        End If
                    End If
            
                Case 5
                    'do nothing
                    
                Case Else
                    'do nothing
            End Select
        
  Exit Sub
EH:
  MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
  Or vbSystemModal, "modLabel8.ZplDocTabYes"
        
End Sub


Private Sub EplDocTabYES()
'--------------------------------------------------------------------------------
'Author: Domonic Grande emp 396671
'Called from: modLabel8.EplChangeLabel
'Purpose: This sub takes the settins provided by frmConfigLabel (held in the reg)
'         and adds EPL code to the label buffer
'--------------------------------------------------------------------------------
        On Error GoTo EH
        
        Dim lngVertical As Long
        
        '-------------------------------------------------
        'Writes comment into epl with overline & underline
        '-------------------------------------------------
        m_strLineItem = vbCrLf & ";------------------" & vbCrLf & ";CUSTOM LABEL BELOW" & vbCrLf & ";------------------" & vbCrLf
        '-----------------------------------------
        'Draws line between FedEx label and custom
        '-----------------------------------------
        ' 2009-07-21, JFW
        ' 2010-12-29, JFW, Line not necessary for Sig Reqd label
        If m_strLabelFeatureSet <> "6" And m_strLabelFeatureSet <> "5" Then
            m_strLineItem = m_strLineItem & "LO10,605,790,2" & vbCrLf
        End If
        
        '---------------------
        '
        '---------------------
        Select Case m_strLabelFeatureSet
            '----------------------
            'Refs, message and Logo
            '----------------------
            Case "0"
                '--------------------------------
                'Holds 30 char line out of messge
                '--------------------------------
                Dim strMessageLine As String
                '---------------------------------------------------------------------------------------------
                'Holds the complete message broken into 5 or 10 lines (depending on len with "^" between lines
                '---------------------------------------------------------------------------------------------
                Dim strParseMessage As String
                '---------------------------------------------------
                'Tells how long to print the message line (30 or 60)
                '---------------------------------------------------
                Dim intLineLen As Integer
                '------------------------------
                'Trim message down to 300 chars
                '------------------------------
                m_strMessage = Left(Trim(m_strMessage), 300)
                '-------------------------------------------
                'Need a var in current scope to check status
                '-------------------------------------------
                Dim strCompleteText As String
                strCompleteText = m_strMessage
                '-----------------------------------------------------------------
                'strCompleteText will start off with the entire message then after
                'the function call it will be stripped of the chars printed line
                'by line until the loop is exited.
                '-----------------------------------------------------------------
                Do Until strCompleteText = ""
                    '---------------------------------------------------------------
                    'Check to see which features are being used.  If logo or other
                    'refs are being used, set the len for the message lines to print
                    '---------------------------------------------------------------
                    If Trim(m_strLogo) = "0" Or Trim(m_strRefOptions) = "1" Then
                        intLineLen = 30
                    ElseIf Trim(m_strLogo) = "1" Or Trim(m_strRefOptions) = "2" Then
                        intLineLen = 60
                    Else
                        intLineLen = 30
                    End If
                    ' 2007-11-09, JFW, I should get 60 char line, but logic above somehow goes 30
                    intLineLen = 60
                        '------------------------------------------------------------
                        'Call function to break message up into lines (len) depending
                        'on other features used
                        '------------------------------------------------------------
                        strMessageLine = modLabel8.WordWrap(strCompleteText, intLineLen)
                        '-------------------------------------------------------------
                        'Container to hold the message with a "^" between lines.  It's
                        'parsed below so each line can be printed separate.
                        '-------------------------------------------------------------
                        If Trim(strParseMessage) = "" Then
                            strParseMessage = strMessageLine
                        Else
                            strParseMessage = strParseMessage & "^" & strMessageLine
                        End If
                Loop
                
                '------------------------
                'Split message out by "^"
                '------------------------
                Dim vrtMessageArray As Variant
                vrtMessageArray = Split(strParseMessage, "^")
                '-----------------------------------------
                'use ubound to see when data can be mapped
                '-----------------------------------------
                Dim intMessageCount As Integer
                intMessageCount = UBound(vrtMessageArray)
                '-----------------------------------------------
                'Parsing the message field into (up to) 10 lines
                '-----------------------------------------------
                If intMessageCount >= 0 Then
                    Dim strMsgLine1 As String
                    strMsgLine1 = vrtMessageArray(0)
                End If
                If intMessageCount >= 1 Then
                    Dim strMsgLine2 As String
                    strMsgLine2 = vrtMessageArray(1)
                End If
                If intMessageCount >= 2 Then
                    Dim strMsgLine3 As String
                    strMsgLine3 = vrtMessageArray(2)
                End If
                If intMessageCount >= 3 Then
                    Dim strMsgLine4 As String
                    strMsgLine4 = vrtMessageArray(3)
                End If
                If intMessageCount >= 4 Then
                    Dim strMsgLine5 As String
                    strMsgLine5 = vrtMessageArray(4)
                End If
                If intMessageCount >= 5 Then
                    Dim strMsgLine6 As String
                    strMsgLine6 = vrtMessageArray(5)
                End If
                If intMessageCount >= 6 Then
                    Dim strMsgLine7 As String
                    strMsgLine7 = vrtMessageArray(6)
                End If
                If intMessageCount >= 7 Then
                    Dim strMsgLine8 As String
                    strMsgLine8 = vrtMessageArray(7)
                End If
                If intMessageCount >= 8 Then
                    Dim strMsgLine9 As String
                    strMsgLine9 = vrtMessageArray(8)
                End If
                If intMessageCount >= 9 Then
                    Dim strMsgLine10 As String
                    strMsgLine10 = vrtMessageArray(9)
                End If

                '-------------------
                'Writes customer URL
                '-------------------
                m_strLineItem = m_strLineItem & "A425,605,0,2,1,1,N," & Chr(34) & m_strURL & Chr(34) & vbCrLf
                        
                    '-------
                    'If logo
                    '-------
                    If m_strLogo = "0" Then
                         m_strLineItem = m_strLineItem & "GG435,250," & Chr(34) & "LOGO1" & Chr(34) & vbCrLf
                    '----------
                    'If NO logo
                    '----------
                    Else
                        m_strLineItem = m_strLineItem
                    End If
                
                    '--------------------------------------------------------
                    '**********Reference for below code**************
                    '"A25,40,0,2,1,2,N,"
                    'A - Printing Text ('B' would be barcode)
                    '25 - starting horizontal position
                    '40 starting vertical position
                    '0 - rotation
                    '2 - font size
                    '1 - horizontal multiplier, expand text horizontally (X2)
                    '2 - vertical multiplier, expand text vetically (X2)
                    'N - normal image
                    '--------------------------------------------------------
                
                    Select Case m_strRefOptions
                        '-----------
                        'Ref Options
                        '-----------
                        Case 0
                            Select Case m_strRefFormat
                                Case 0
                                    '-------------------
                                    'human readable only
                                    '-------------------
                                    m_strLineItem = m_strLineItem & "A25,215,0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,240,0,2,1,2,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                    
                                    m_strLineItem = m_strLineItem & "A25,305,0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,330,0,2,1,2,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                    
                                    m_strLineItem = m_strLineItem & "A25,395,0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,420,0,2,1,2,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                    
                                    m_strLineItem = m_strLineItem & "A25,485,0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,510,0,2,1,2,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                Case 1
                                    '------------
                                    'Barcode only
                                    '------------
                                    m_strLineItem = m_strLineItem & "A25,215,0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                    If Trim(m_strRef1) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,240,0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,305,0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                    If Trim(m_strRef2) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,330,0,1,2,6,40,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,395,0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                    If Trim(m_strRef3) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,420,0,1,2,6,40,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,485,0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                    If Trim(m_strRef4) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,510,0,1,2,6,40,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                    End If
                                Case 2
                                    '---------------------
                                    'BARCODES AND READABLE
                                    '---------------------
                                    m_strLineItem = m_strLineItem & "A25,215,0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,240,0,2,1,1,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                    If Trim(m_strRef1) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,260,0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,305,0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,330,0,2,1,1,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                    If Trim(m_strRef2) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,350,0,1,2,6,40,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,395,0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,420,0,2,1,1,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                    If Trim(m_strRef3) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,440,0,1,2,6,40,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                    End If
                                    
                                    m_strLineItem = m_strLineItem & "A25,485,0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,510,0,2,1,1,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                    If Trim(m_strRef4) <> "" Then
                                        m_strLineItem = m_strLineItem & "B25,530,0,1,2,6,40,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                    End If
                                Case Else
                             End Select
                        '-----------------
                        '2 ref's & message
                        '-----------------
                        Case 1
                                                                    
                            Select Case m_strRefFormat
                                '---------------
                                'Format to print
                                '---------------
                                Case 0
                                    '--------------
                                    'human readable
                                    '--------------
                                    lngVertical = 215
                                    If m_strRef1Cap <> "" And lngVertical <= 275 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,2,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                        lngVertical = lngVertical + 60
                                    End If
                                    If m_strRef2Cap <> "" And lngVertical <= 275 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,2,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                        lngVertical = lngVertical + 60
                                    End If
                                    If m_strRef3Cap <> "" And lngVertical <= 275 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,2,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                        lngVertical = lngVertical + 60
                                    End If
                                    If m_strRef4Cap <> "" And lngVertical <= 275 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,2,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                        lngVertical = lngVertical + 60
                                    End If
                                    '-------------
                                    'message field
                                    '-------------
                                    m_strLineItem = m_strLineItem & "A25,345,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,375,0,2,1,1,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,395,0,2,1,1,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,415,0,2,1,1,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,435,0,2,1,1,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,455,0,2,1,1,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,475,0,2,1,1,N," & Chr(34) & strMsgLine6 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,495,0,2,1,1,N," & Chr(34) & strMsgLine7 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,515,0,2,1,1,N," & Chr(34) & strMsgLine8 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,535,0,2,1,1,N," & Chr(34) & strMsgLine9 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,555,0,2,1,1,N," & Chr(34) & strMsgLine10 & Chr(34) & vbCrLf
                                Case 1
                                    '------------
                                    'barcode only
                                    '------------
                                    lngVertical = 215
                                    If m_strRef1Cap <> "" And lngVertical <= 275 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                        If Trim(m_strRef1) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 25) & ",0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 75
                                    End If
                                    If m_strRef2Cap <> "" And lngVertical <= 290 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                        If Trim(m_strRef2) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 25) & ",0,1,2,6,40,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 75
                                    End If
                                    If m_strRef3Cap <> "" And lngVertical <= 290 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                        If Trim(m_strRef3) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 25) & ",0,1,2,6,40,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 75
                                    End If
                                    If m_strRef4Cap <> "" And lngVertical <= 290 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                        If Trim(m_strRef4) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 25) & ",0,1,2,6,40,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 75
                                    End If
                                    '-------------
                                    'message field
                                    '-------------
                                    m_strLineItem = m_strLineItem & "A25,380,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,410,0,2,1,1,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,430,0,2,1,1,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,450,0,2,1,1,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,470,0,2,1,1,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,490,0,2,1,1,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,510,0,2,1,1,N," & Chr(34) & strMsgLine6 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,530,0,2,1,1,N," & Chr(34) & strMsgLine7 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,550,0,2,1,1,N," & Chr(34) & strMsgLine8 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,570,0,2,1,1,N," & Chr(34) & strMsgLine9 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,590,0,2,1,1,N," & Chr(34) & strMsgLine10 & Chr(34) & vbCrLf
                                Case 2
                                    '------------------------
                                    'Human readable & barcode
                                    '------------------------
                                    lngVertical = 215
                                    If m_strRef1Cap <> "" And lngVertical <= 305 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef1Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,1,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                        If Trim(m_strRef1) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 45) & ",0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 90
                                    End If
                                    If m_strRef2Cap <> "" And lngVertical <= 305 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef2Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,1,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                        If Trim(m_strRef2) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 45) & ",0,1,2,6,40,N," & Chr(34) & m_strRef2 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 90
                                    End If
                                    If m_strRef3Cap <> "" And lngVertical <= 305 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef3Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,1,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                        If Trim(m_strRef3) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 45) & ",0,1,2,6,40,N," & Chr(34) & m_strRef3 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 90
                                    End If
                                    If m_strRef4Cap <> "" And lngVertical <= 305 Then
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical) & ",0,4,1,1,N," & Chr(34) & m_strRef4Cap & Chr(34) & vbCrLf
                                        m_strLineItem = m_strLineItem & "A25," & CStr(lngVertical + 25) & ",0,2,1,1,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                        If Trim(m_strRef4) <> "" Then
                                            m_strLineItem = m_strLineItem & "B25," & CStr(lngVertical + 45) & ",0,1,2,6,40,N," & Chr(34) & m_strRef4 & Chr(34) & vbCrLf
                                        End If
                                        lngVertical = lngVertical + 90
                                    End If
                                    '-------------
                                    'message field
                                    '-------------
                                    m_strLineItem = m_strLineItem & "A25,400,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,430,0,2,1,1,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,450,0,2,1,1,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,470,0,2,1,1,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,490,0,2,1,1,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,510,0,2,1,1,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,530,0,2,1,1,N," & Chr(34) & strMsgLine6 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,550,0,2,1,1,N," & Chr(34) & strMsgLine7 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,570,0,2,1,1,N," & Chr(34) & strMsgLine8 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,590,0,2,1,1,N," & Chr(34) & strMsgLine9 & Chr(34) & vbCrLf
                                    m_strLineItem = m_strLineItem & "A25,610,0,2,1,1,N," & Chr(34) & strMsgLine10 & Chr(34) & vbCrLf
                                Case Else
                             End Select
                        '------------
                        'message only
                        '------------
                        Case 2
                            '-----------------------------------------------------
                            'if no logo and message only, use whole width of label
                            '-----------------------------------------------------
                            If m_strLogo = "0" Then
                                m_strLineItem = m_strLineItem & "A25,345,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,375,0,2,1,1,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,395,0,2,1,1,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,415,0,2,1,1,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,435,0,2,1,1,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,455,0,2,1,1,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,475,0,2,1,1,N," & Chr(34) & strMsgLine6 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,495,0,2,1,1,N," & Chr(34) & strMsgLine7 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,515,0,2,1,1,N," & Chr(34) & strMsgLine8 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,535,0,2,1,1,N," & Chr(34) & strMsgLine9 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,555,0,2,1,1,N," & Chr(34) & strMsgLine10 & Chr(34) & vbCrLf
                            Else
                                m_strLineItem = m_strLineItem & "A25,345,0,4,1,1,N," & Chr(34) & m_strMessageCaption & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,375,0,2,1,2,N," & Chr(34) & strMsgLine1 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,415,0,2,1,2,N," & Chr(34) & strMsgLine2 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,455,0,2,1,2,N," & Chr(34) & strMsgLine3 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,495,0,2,1,2,N," & Chr(34) & strMsgLine4 & Chr(34) & vbCrLf
                                m_strLineItem = m_strLineItem & "A25,535,0,2,1,2,N," & Chr(34) & strMsgLine5 & Chr(34) & vbCrLf
                            End If
                        Case Else
                    End Select
        
            Case "1"
                '------------------------------------------------------------------------------------
                'The below code prints a pick ticket on the 2" space above the FedEx Common Label
                'on 8" label stock.  See the UserDefinedType (PickTicketValues) in modLabel8 (dec's).
                '------------------------------------------------------------------------------------
                With m_udtPickTicket
                    '-----
                    'Ref's
                    '-----
                    m_strLineItem = m_strLineItem & "A10,220,0,4,1,1,N," & Chr(34) & .BatchIdCap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,220,0,4,1,1,N," & Chr(34) & .BatchId & Chr(34) & vbCrLf
        
                    m_strLineItem = m_strLineItem & "A10,245,0,4,1,1,N," & Chr(34) & .PicRef1Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,245,0,4,1,1,N," & Chr(34) & .PicRef1 & Chr(34) & vbCrLf
        
                    m_strLineItem = m_strLineItem & "A10,270,0,4,1,1,N," & Chr(34) & .PicRef2Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,270,0,4,1,1,N," & Chr(34) & .PicRef2 & Chr(34) & vbCrLf
    
                    m_strLineItem = m_strLineItem & "A10,295,0,4,1,1,N," & Chr(34) & .PicRef3Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,295,0,4,1,1,N," & Chr(34) & .PicRef3 & Chr(34) & vbCrLf
    
                    m_strLineItem = m_strLineItem & "A10,320,0,4,1,1,N," & Chr(34) & .PicRef4Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A180,320,0,4,1,1,N," & Chr(34) & .PicRef4 & Chr(34) & vbCrLf
                   '-----------
                   'COL HEADERS
                   '-----------
                    m_strLineItem = m_strLineItem & "A60,355,0,4,1,1,N," & Chr(34) & .ColHeader1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,355,0,4,1,1,N," & Chr(34) & .ColHeader2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,355,0,4,1,1,N," & Chr(34) & .ColHeader3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,355,0,4,1,1,N," & Chr(34) & .ColHeader4 & Chr(34) & vbCrLf
                    '----
                    'row1
                    '----
                    m_strLineItem = m_strLineItem & "A60,380,0,2,1,1,N," & Chr(34) & .Row01Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,380,0,2,1,1,N," & Chr(34) & .Row01Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,380,0,2,1,1,N," & Chr(34) & .Row01Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,380,0,2,1,1,N," & Chr(34) & .Row01Col4 & Chr(34) & vbCrLf
                    '----
                    'row2
                    '----
                    m_strLineItem = m_strLineItem & "A60,400,0,2,1,1,N," & Chr(34) & .Row02Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,400,0,2,1,1,N," & Chr(34) & .Row02Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,400,0,2,1,1,N," & Chr(34) & .Row02Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,400,0,2,1,1,N," & Chr(34) & .Row02Col4 & Chr(34) & vbCrLf
                    '----
                    'row3
                    '----
                    m_strLineItem = m_strLineItem & "A60,420,0,2,1,1,N," & Chr(34) & .Row03Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,420,0,2,1,1,N," & Chr(34) & .Row03Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,420,0,2,1,1,N," & Chr(34) & .Row03Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,420,0,2,1,1,N," & Chr(34) & .Row03Col4 & Chr(34) & vbCrLf
                    '----
                    'row4
                    '----
                    m_strLineItem = m_strLineItem & "A60,440,0,2,1,1,N," & Chr(34) & .Row04Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,440,0,2,1,1,N," & Chr(34) & .Row04Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,440,0,2,1,1,N," & Chr(34) & .Row04Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,440,0,2,1,1,N," & Chr(34) & .Row04Col4 & Chr(34) & vbCrLf
                    '----
                    'row5
                    '----
                    m_strLineItem = m_strLineItem & "A60,460,0,2,1,1,N," & Chr(34) & .Row05Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,460,0,2,1,1,N," & Chr(34) & .Row05Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,460,0,2,1,1,N," & Chr(34) & .Row05Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,460,0,2,1,1,N," & Chr(34) & .Row05Col4 & Chr(34) & vbCrLf
                    '----
                    'row6
                    '----
                    m_strLineItem = m_strLineItem & "A60,480,0,2,1,1,N," & Chr(34) & .Row06Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,480,0,2,1,1,N," & Chr(34) & .Row06Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,480,0,2,1,1,N," & Chr(34) & .Row06Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,480,0,2,1,1,N," & Chr(34) & .Row06Col4 & Chr(34) & vbCrLf
                    '----
                    'row7
                    '----
                    m_strLineItem = m_strLineItem & "A60,500,0,2,1,1,N," & Chr(34) & .Row07Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,500,0,2,1,1,N," & Chr(34) & .Row07Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,500,0,2,1,1,N," & Chr(34) & .Row07Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,500,0,2,1,1,N," & Chr(34) & .Row07Col4 & Chr(34) & vbCrLf
                    '----
                    'row8
                    '----
                    m_strLineItem = m_strLineItem & "A60,520,0,2,1,1,N," & Chr(34) & .Row08Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,520,0,2,1,1,N," & Chr(34) & .Row08Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,520,0,2,1,1,N," & Chr(34) & .Row08Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,520,0,2,1,1,N," & Chr(34) & .Row08Col4 & Chr(34) & vbCrLf
                    '----
                    'row9
                    '----
                    m_strLineItem = m_strLineItem & "A60,540,0,2,1,1,N," & Chr(34) & .Row09Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,540,0,2,1,1,N," & Chr(34) & .Row09Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,540,0,2,1,1,N," & Chr(34) & .Row09Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,540,0,2,1,1,N," & Chr(34) & .Row09Col4 & Chr(34) & vbCrLf
                    '-----
                    'row10
                    '-----
                    m_strLineItem = m_strLineItem & "A60,560,0,2,1,1,N," & Chr(34) & .Row10Col1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A300,560,0,2,1,1,N," & Chr(34) & .Row10Col2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,560,0,2,1,1,N," & Chr(34) & .Row10Col3 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A700,560,0,2,1,1,N," & Chr(34) & .Row10Col4 & Chr(34) & vbCrLf
                    '---------------
                    'Footer captions
                    '---------------
                    m_strLineItem = m_strLineItem & "A10,595,0,3,1,1,N," & Chr(34) & .TicketFooter1Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A250,595,0,3,1,1,N," & Chr(34) & .TicketFooter2Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A500,595,0,3,1,1,N," & Chr(34) & .TicketFooter3Cap & Chr(34) & vbCrLf
                    '-------
                    'Footers
                    '-------
                    m_strLineItem = m_strLineItem & "A148,598,0,2,1,1,N," & Chr(34) & .TicketFooter1 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A380,598,0,2,1,1,N," & Chr(34) & .TicketFooter2 & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A640,598,0,2,1,1,N," & Chr(34) & .TicketFooter3 & Chr(34) & vbCrLf
                    
                End With
            '-------
            'sort id
            '-------
            Case "2"
                '-------------------------------------------------------
                'Depending on fonts size selected, print sort id feature
                '-------------------------------------------------------
                If Trim(m_strSortIdFontSize) = "0" Then
                    '--------------------------------------------------------------------
                    'Data being converted to ucase because font used does not allow lower
                    '--------------------------------------------------------------------
                    m_strSortID = UCase(Left(Trim(m_strSortID), 5))
                    m_strLineItem = m_strLineItem & "A50,210,0,5,4,8,N," & Chr(34) & m_strSortID & Chr(34) & vbCrLf
                ElseIf Trim(m_strSortIdFontSize) = "1" Then
                    m_strSortID = UCase(Left(Trim(m_strSortID), 12))
                    m_strLineItem = m_strLineItem & "A20,210,0,4,4,8,N," & Chr(34) & m_strSortID & Chr(34) & vbCrLf
                Else
                    'do nothing
                End If
            '------
            'sscc18
            '------
            Case "3"
                '-------
                'Barcode
                '-------
                m_strLineItem = m_strLineItem & "B150,300,0,0,3,4,210,N," & Chr(34) & m_strSSCC18 & Chr(34) & vbCrLf
                '---------------------------------------------------
                'Human readable broken out to look industry standard
                '---------------------------------------------------
                m_strLineItem = m_strLineItem & "A150,520,0,2,1,2,N," & Chr(34) & "(" & Left(m_strSSCC18, 2) & _
                ")" & Space(2) & Mid(m_strSSCC18, 3, 18) & Chr(34) & vbCrLf
            '-----------------
            'Bed Bath & Beyond
            '-----------------
            Case "4"
                With m_udtBedBathBeyond
                    '--------------
                    'sscc18 Barcode
                    '--------------
                    m_strLineItem = m_strLineItem & "B150,360,0,0,3,4,210,N," & Chr(34) & .SSCC18 & Chr(34) & vbCrLf
                    '--------------
                    'Human Readable
                    '--------------
                    m_strLineItem = m_strLineItem & "A150,580,0,2,1,2,N," & Chr(34) & "SSCC18 - " & "(" & Left(.SSCC18, 2) & _
                    ")" & Space(2) & Mid(.SSCC18, 3, 18) & Chr(34) & vbCrLf
                    '---------
                    'Po Number
                    '---------
                    m_strLineItem = m_strLineItem & "A10,210,0,4,1,1,N," & Chr(34) & "PO #: " & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A100,210,0,5,1,1,N," & Chr(34) & .PoNumber & Chr(34) & vbCrLf
                    '------------
                    'Store Number
                    '------------
                    m_strLineItem = m_strLineItem & "A200,290,0,4,1,1,N," & Chr(34) & "Store #: " & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A340,290,0,5,1,1,N," & Chr(34) & .StoreNumber & Chr(34) & vbCrLf
                    '-------------
                    'Vendor Number
                    '-------------
                    m_strLineItem = m_strLineItem & "A400,210,0,4,1,1,N," & Chr(34) & "Vendor #: " & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A555,210,0,5,1,1,N," & Chr(34) & .VendorNumber & Chr(34) & vbCrLf
                    
                End With
            '------
            'signature required
            '------
            Case "5"
                If Cafe1.SignatureRequiredStyle = 1 Then
                    m_strLineItem = m_strLineItem & "LO30,220,730,10" & vbCrLf
                    m_strLineItem = m_strLineItem & "LO30,220,10,370" & vbCrLf
                    m_strLineItem = m_strLineItem & "LO755,220,10,370" & vbCrLf
                    m_strLineItem = m_strLineItem & "LO30,585,735,10" & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,250,0,3,2,3,R," & Chr(34) & "   SIGNATURE REQUIRED   " & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,335,0,3,1,2,N," & Chr(34) & "DELIVER TO CONSIGNEE'S ADDRESS ONLY" & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,375,0,2,1,2,N," & Chr(34) & "  * No Indirect Delivery" & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,415,0,2,1,2,N," & Chr(34) & "  * No Delivery Release Signature" & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,485,0,3,1,2,N," & Chr(34) & "LIVRER UNIQUEMENT A L'ADRESSE DU DESTINATAIRE" & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A60,525,0,2,1,2,N," & Chr(34) & "  * Aucune livraison indirecte ni signature de decharge" & Chr(34) & vbCrLf
                End If
                
            '------
            'FedEx Canada custom bar code
            '------
            Case "6"
                ' Nothing to do here
             
            Case Else
                MsgBox "Label feature set not defined", vbExclamation Or vbSystemModal, "Error"
            
        End Select
            '-------------
            'Doc tab setup
            '-------------
            Select Case m_strDocTabInfo
                Case 0
                    '--------------------------
                    'do nothing standard doctab
                    '--------------------------
                Case 1
                    '----------------------------
                    'CR: human readable & Barcode
                    '----------------------------
                    m_strLineItem = m_strLineItem & "A15,10,0,4,1,1,N," & Chr(34) & m_strDocRef1Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A150,10,0,4,1,1,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                    If Trim(m_strRef1) <> "" Then
                        m_strLineItem = m_strLineItem & "B150,40,0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                    End If
                Case 2
                    '----------------------------
                    'CR: human readable & Barcode
                    '----------------------------
                    m_strLineItem = m_strLineItem & "A15,20,0,4,1,1,N," & Chr(34) & m_strDocRef1Cap & Chr(34) & vbCrLf
                    m_strLineItem = m_strLineItem & "A150,20,0,4,1,1,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                    If Trim(m_strRef1) <> "" Then
                        m_strLineItem = m_strLineItem & "B150,50,0,1,2,6,40,N," & Chr(34) & m_strRef1 & Chr(34) & vbCrLf
                    End If
                    '-------------------------------
                    'Track: human readable & Barcode
                    '-------------------------------
                    If m_strIDMps = "Y" Then
                        '---------------------------------------------------------------------------------------------
                        'If idMps use tracking number pulled from print buffer in modLabel8.ChangeLabel.  Events don't
                        'match labels to pull from tbl or obj.
                        '---------------------------------------------------------------------------------------------
                        m_strLineItem = m_strLineItem & "A15,120,0,4,1,1,N," & Chr(34) & m_strDocRef2Cap & Chr(34) & vbCrLf
                        m_strLineItem = m_strLineItem & "A150,120,0,4,1,1,N," & Chr(34) & m_strIdMpsTrack & Chr(34) & vbCrLf
                        m_strLineItem = m_strLineItem & "B150,150,0,1,2,6,40,N," & Chr(34) & m_strIdMpsTrack & Chr(34) & vbCrLf
                    Else
                        m_strLineItem = m_strLineItem & "A15,120,0,4,1,1,N," & Chr(34) & m_strDocRef2Cap & Chr(34) & vbCrLf
                        m_strLineItem = m_strLineItem & "A150,120,0,4,1,1,N," & Chr(34) & m_strTrackingNumber & Chr(34) & vbCrLf
                        m_strLineItem = m_strLineItem & "B150,150,0,1,2,6,40,N," & Chr(34) & m_strTrackingNumber & Chr(34) & vbCrLf
                    End If
                Case Else
                    'do nothing
            End Select
        
  Exit Sub
EH:
  MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
  Or vbSystemModal, "modLabel8.EplDocTabYes"
        
End Sub
'

Public Sub EplRemoveAWB()

End Sub
'

Public Sub ZplRemoveAWB()
'----------------------------------------------------------------------------
'Author: Domonic Grande emp 396671
'Called from: modLabel8.ProcessSingle or .ProcessBatch
'Purpose: This sub addresses ONLY ZPL BUFFERS.  It loops through an opened
'         label buffer (txt file) and moves the FedEx shipping label down
'         about 2" depending on the label stock.  Once room is made, it calls
'         a sub (depending on label stock) to add to the label requested
'         features from frmLabelConfig.
'----------------------------------------------------------------------------
        
    On Error GoTo EH
    
    Dim strLine As String
    Dim strLabel As String
    Dim boolRemoveAWB As Boolean
    Dim boolDryIce As Boolean
    Dim i As Long
    Dim strTrackingNumber As String
    Dim strReferenceNumber As String
    
    Do
        strLabel = ""
        boolRemoveAWB = False
        boolDryIce = False
        Do
        
            'Read line from txt file (buffer) into m_strLineItem
            Line Input #1, strLine
            If strLabel <> "" _
            And UCase(Left(strLine, 3)) = "^XA" Then
                MsgBox "Label8.ZplRemoveAWB, Unexpected format of label.  "
            End If
            
            If 0 <> InStr(1, UCase(strLine), UCase(": Dry Ice")) Then
                ' Logfile "ZplRemoveAWB, Dry Ice label detected."
                boolDryIce = True
            End If
            
            If m_boolRemoveAWB Then
                If 0 <> InStr(1, UCase(strLine), "CONSIGNEE AWB COPY") Then
                    If Not boolDryIce Then
                        ' Logfile "ZplRemoveAWB, Extra label (AWB) being suppressed."
                        boolRemoveAWB = True
                    End If
                End If
            End If
            
            If m_boolRemoveExtraLabels Then
                If 0 <> InStr(1, UCase(strLine), "PLACE THIS LABEL ON PACKAGE") Then
                    If Not boolDryIce Then
                        ' Logfile "ZplRemoveAWB, Extra label (Saturday/First) being suppressed."
                        boolRemoveAWB = True
                    End If
                End If
            End If
            
            strLabel = strLabel & strLine & vbCrLf
            
            If UCase(Left(strLine, 3)) = "^XZ" Then Exit Do
            
        Loop Until VBA.EOF(1)
        
        ' Analyse the label and try to get the tracking number
        i = InStr(1, strLabel, "^FD>;")
        If i > 0 Then
            strTrackingNumber = Mid(strLabel, i + 21, 12)
        Else
            i = InStr(1, strLabel, "^FDTrk#")
            If i > 0 Then
                strTrackingNumber = Mid(strLabel, i + 8, 14)
                strTrackingNumber = Replace(strTrackingNumber, " ", "")
            Else
                strTrackingNumber = ""
            End If
        End If
        
        i = InStr(1, strLabel, "^FDREF:")
        If i > 0 Then
            strReferenceNumber = Mid(strLabel, i + 3, InStr(i + 3, strLabel, "^") - i - 3)
            ' Logfile "ZplRemoveAWB, Label analysis, reference number " & strReferenceNumber & "."
        Else
            strReferenceNumber = ""
        End If
        If boolDryIce Or Not boolRemoveAWB Then
            ' Logfile "ZplRemoveAWB, Label accepted for printing, tracking number " & strTrackingNumber & "."
            m_strBuildNewLabel = m_strBuildNewLabel & strLabel
        Else
            ' Logfile "ZplRemoveAWB, Extra label not printed, tracking number " & strTrackingNumber & "."
        End If
        
    Loop Until VBA.EOF(1)
     
    Exit Sub
    
EH:
  MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
  Or vbSystemModal, "modLabel8.ZplRemoveAWB"
    
End Sub
'

Public Sub EventAfterShipment(Optional strTrackingNumber As String = "")
    '--------------------------------------------------------
    'In case of MPS, INT or COD, labels are Q-ed and printed
    'from the afterShipment event.  This prints them and does
    'all file clean up
    '--------------------------------------------------------
    On Error GoTo EH
      
    If m_strTrackingNumber = "" Then
        m_strTrackingNumber = strTrackingNumber
        ' Logfile "EventAfterShipment", "Tracking number 1 " & strTrackingNumber
    Else
        ' Logfile "EventAfterShipment", "Tracking number 2 " & strTrackingNumber & " processing " & m_strTrackingNumber
    End If
    
    '----------------------------------------
    'Flag is set telling when to print labels
    '----------------------------------------
    If m_blnPrintFromAfterShipment = True Then
    
        ' Logfile "EventAfterShipment", "Calling ProcessSingle"
        
        '---------------------------------------
        'pass .proc as false.  Last time through
        'loop.  Does not matter if .proc or not
        '---------------------------------------
        modLabel8.ProcessSingle False
        modLabel8.PrintLabel
    End If
    '--------------------
    'Clears modLevel vars
    '--------------------
    modLabel8.ClearModVars
    Exit Sub
EH:
    MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
        Or vbSystemModal, "modLabel8.EventAfterShipMent"

End Sub

Public Sub EventBeforeShipPackage()
    '------------------------------------------------------------------
    'Error happens when return label is printed.  Screen can't be id'ed
    'by handle.  Code running is no harm if error raises or not
    '------------------------------------------------------------------
    On Error Resume Next
    '-----------
    'ID mps flag
    '-----------
    m_strIDMps = Cafe1.Screen.GetField(408)
            
    
    Exit Sub
EH:
  MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
  Or vbSystemModal, "modLabel8.EventBeforeShipPackage"
End Sub

Public Sub ClearModVars()
    '----------------------------------
    'Author: Domonic Grande emp# 396671
    'Called from: Cafe1.AfterShipMent
    'Desc: Clears all modLevel Vars
    '----------------------------------
    On Error GoTo EH
        
    m_strLabelFeatureSet = ""
    m_strSortIdFontSize = ""
    m_strSSCC18 = ""
    m_strSortID = ""
    m_strPrinterName = ""
    m_strPrinterType = ""
    m_strUNC = ""
    m_strIdMpsTrack = ""
    m_strLabelStock = ""
    m_strLogo = ""
    m_strRefOptions = ""
    m_strRefFormat = ""
    m_strDocTabInfo = ""
    m_strURL = ""
    m_strRef1 = ""
    m_strRef2 = ""
    m_strRef3 = ""
    m_strRef4 = ""
    m_strRef1Cap = ""
    m_strRef2Cap = ""
    m_strRef3Cap = ""
    m_strRef4Cap = ""
    m_strDocRef1 = ""
    m_strDocRef2 = ""
    m_strDocRef1Cap = ""
    m_strDocRef2Cap = ""
    m_strMessageCaption = ""
    m_strMessage = ""
    m_strLabelTempFolder = ""
    m_strBufferFile = ""
    ' Logfile "ClearModVars", "Tracking blank"
    m_strTrackingNumber = ""
    m_strLineItem = ""
    m_strBuildNewLabel = ""
    m_blnPrintFromAfterShipment = False
    m_strIDMps = ""
    m_blnDotProcess = False
    m_blnBatchProc = False
    m_strCodFlag = ""
    
    
    '-----------------------------------------------------------------------------
    'This is a User Defined Type (udt).  This is created in the dec's of modLabel8
    'and is public.
    '-----------------------------------------------------------------------------
    With m_udtPickTicket
        
        .BatchId = ""
        .BatchIdCap = ""
        
        .PicRef1 = ""
        .PicRef2 = ""
        .PicRef3 = ""
        .PicRef4 = ""
        
        .PicRef1Cap = ""
        .PicRef2Cap = ""
        .PicRef3Cap = ""
        .PicRef4Cap = ""
        
        .ColHeader1 = ""
        .ColHeader2 = ""
        .ColHeader3 = ""
        .ColHeader4 = ""
        
        .TicketFooter1 = ""
        .TicketFooter2 = ""
        .TicketFooter3 = ""
        
        .TicketFooter1Cap = ""
        .TicketFooter2Cap = ""
        .TicketFooter3Cap = ""
        
        .Row01Col1 = ""
        .Row01Col2 = ""
        .Row01Col3 = ""
        .Row01Col4 = ""
    
        .Row02Col1 = ""
        .Row02Col2 = ""
        .Row02Col3 = ""
        .Row02Col4 = ""
    
        .Row03Col1 = ""
        .Row03Col2 = ""
        .Row03Col3 = ""
        .Row03Col4 = ""
    
        .Row04Col1 = ""
        .Row04Col2 = ""
        .Row04Col3 = ""
        .Row04Col4 = ""
    
        .Row05Col1 = ""
        .Row05Col2 = ""
        .Row05Col3 = ""
        .Row05Col4 = ""
    
        .Row06Col1 = ""
        .Row06Col2 = ""
        .Row06Col3 = ""
        .Row06Col4 = ""
    
        .Row07Col1 = ""
        .Row07Col2 = ""
        .Row07Col3 = ""
        .Row07Col4 = ""
    
        .Row08Col1 = ""
        .Row08Col2 = ""
        .Row08Col3 = ""
        .Row08Col4 = ""
    
        .Row09Col1 = ""
        .Row09Col2 = ""
        .Row09Col3 = ""
        .Row09Col4 = ""
    
        .Row10Col1 = ""
        .Row10Col2 = ""
        .Row10Col3 = ""
        .Row10Col4 = ""
        
    End With
    
    With m_udtBedBathBeyond
        .PoNumber = ""
        .SSCC18 = ""
        .StoreNumber = ""
        .VendorNumber = ""
    End With
    
    ' 2010-12-31, JFW
    ' 2011-03-16, JFW, Comment out here
    ' m_lngFirstLabelDelay = 40000
    
    Exit Sub
EH:
  MsgBox "Error Number: " & Err.Number & vbCrLf & Err.Description, vbCritical _
  Or vbSystemModal, "modLabel8.ClearModVars"

End Sub



Public Function WordWrap(ByRef strCompleteText As String, intLineLength As Integer) As String

'---------------------------------------------------------------------------------------------
' Author: Meeshel Bipatnath
' Procedure : WordWrap
' DateTime  : 3/16/2006
' Purpose   : Returns a line of text that will fit on line with specified number of characters
'---------------------------------------------------------------------------------------------

    '-----------------------
    'declare local variables
    '-----------------------
    Dim i As Integer
    Dim strCurrWord As String
    Dim strText As String
    
    '---------------------
    'initialize variables
    '---------------------
    i = 1
    strText = strCompleteText
    
    '-----------------
    'loop through text
    '-----------------
    Do Until i > Len(strCompleteText)
        
        '---------------------
        'Get next word in text
        '---------------------
        strCurrWord = ""
        strCurrWord = GetWord(strText)
       
        '------------------------------------------
        'Move i to next beginning of the next word
        '------------------------------------------
        i = i + Len(strCurrWord)
        
        '-----------------------------------
        'Check if word will fit on this line
        '-----------------------------------
        If Len(strCurrWord) <= intLineLength + 1 Then
            WordWrap = WordWrap & strCurrWord
            intLineLength = intLineLength - Len(strCurrWord)
            'Remove word from remaining text
            strText = Right(strText, Len(strText) - Len(strCurrWord))
        Else
            Exit Do
        End If
        
                        
    Loop
    
    strCompleteText = strText
            
    Exit Function
    
EH:
    MsgBox Err.Description, vbSystemModal, "Error in modLabel8.WordWrap"
End Function


Public Function GetWord(ByVal strLine As String) As String
'-----------------------------------------------
' Procedure : GetWord
' DateTime  : 3/16/2006
' Purpose   : Returns a word from a line of text
'-----------------------------------------------
    On Error GoTo EH
    
    '-----------------------
    'declare local variables
    '-----------------------
    Dim strChar As String
    Dim i As Integer
        
    '---------------------
    'initialize variables
    '---------------------
    i = 1
    
    '------------------------------------------
    'loop through line until a word is captured
    '------------------------------------------
    Do Until i > Len(strLine)

        '------------------
        'Get next character
        '------------------
        strChar = Mid(strLine, i, 1)
        GetWord = GetWord & strChar

        '---------------------------------------------------
        'Words are separated by a space, comma, or semicolon
        '---------------------------------------------------
        Select Case strChar
            Case " ", ",", ";"
                Exit Do
        End Select

        i = i + 1

    Loop
    
    Exit Function
    
EH:
    MsgBox Err.Description, vbSystemModal, "Error in modLabel8.GetWord"
End Function



Public Sub PrintErrorLabel(ByVal objPackage As Package, ByVal strErrorMessage As String)
    
    Dim objFSO As FileSystemObject
    Set objFSO = New FileSystemObject
        
    modLabel8.GetSettings
        
    If m_strUNC <> "" Then
        
        ' Logfile "modLabel8.PrintErrorLabel", "UNC " & m_strUNC
        
        If m_strPrinterType = "0" Then
              Call EplErrorLabel(objPackage, strErrorMessage)
        Else
              Call ZplErrorLabel(objPackage, strErrorMessage)
        End If
        
        With objFSO
            If UCase(Left(m_strUNC, 3)) = "C:\" Then
                m_lngBufferFile = m_lngBufferFile + 1
                .CopyFile m_strLabelTempFolder & m_strBufferFile, m_strUNC & "\Label_" & Format(Now, "HHnnss") & m_lngBufferFile & ".txt"
            Else
                .CopyFile m_strLabelTempFolder & m_strBufferFile, m_strUNC
            End If
            ' Logfile "modLabel8.PrintLabel", "Delete file " & m_strLabelTempFolder & m_strBufferFile
            .DeleteFile m_strLabelTempFolder & m_strBufferFile
        End With
    End If
    
Release:
    Set objFSO = Nothing
    Exit Sub
    
EH:
    MsgBox Err.Description & vbCrLf & Err.Number, vbSystemModal, "modLabel8.PrintErrorLabel"
    Resume Release
    If False Then
        Resume
    End If

End Sub
'



Private Sub EplErrorLabel(ByVal objPackage As Package, ByVal strErrorMessage As String)

End Sub
'

Private Sub ZplErrorLabel(ByVal objPackage As Package, ByVal strErrorMessage As String)
    
    On Local Error GoTo Handler
    
    Dim objFSO As FileSystemObject
    Dim objfile As File
    Dim strMiscellaneousPaymentType As String
    Dim strRecord As String
    Dim strFilename As String
    
    Set objFSO = New FileSystemObject
    If objFSO.FileExists(m_strLabelTempFolder & m_strBufferFile) Then
        objFSO.DeleteFile m_strLabelTempFolder & m_strBufferFile, True
    End If
    
    With objFSO.CreateTextFile(m_strLabelTempFolder & m_strBufferFile, True)
            
        .WriteLine "^XA^CF,0,0,0^PR12^MD30^PW800^POI^CI13^LH0,20"
        .WriteLine "^FO10,308^GB790,2,2^FS"
        .WriteLine "^FO10,565^GB790,2,2^FS"
        .WriteLine "^FO477,162^GB2,146,2^FS"
        .WriteLine "^FO35,169^AdN,0,0^FWN^FH^FDORIGIN ID: " & objPackage.Sender.Code & "^FS"
        .WriteLine "^FO35,188^AdN,0,0^FWN^FH^FD" & objPackage.Sender.Contact & "^FS"
        .WriteLine "^FO35,208^AdN,0,0^FWN^FH^FD" & objPackage.Sender.Company & "^FS"
        .WriteLine "^FO35,228^AdN,0,0^FWN^FH^FD" & objPackage.Sender.Address1 & "^FS"
        .WriteLine "^FO35,249^AdN,0,0^FWN^FH^FD" & objPackage.Sender.Address2 & "^FS"
        .WriteLine "^FO35,269^AdN,0,0^FWN^FH^FD" & objPackage.Sender.City & ", " & objPackage.Sender.State & " " & objPackage.Sender.Zip & "^FS"
        .WriteLine "^FO35,289^AdN,0,0^FWN^FH^FD" & IIf(objPackage.Sender.Country = "CA", "CANADA ", IIf(objPackage.Sender.Country = "US", "UNITED STATES ", "")) & objPackage.Sender.Country & "^FS"
        .WriteLine "^FO490,169^AdN,0,0^FWN^FH^FDShip Date: " & objPackage.SpecialServices.FutureShipment.ShipDate & "^FS"
        .WriteLine "^FO490,208^AdN,0,0^FWN^FH^FDCAD: " & objPackage.Meter & "/FSMS^FS"
        If objPackage.PaymentType = fsmBill_Recipient Then
            .WriteLine "^FO490,228^AdN,0,0^FWN^FH^FDAccount: R " & objPackage.Recipient.AccountNo & "^FS"
        ElseIf objPackage.PaymentType = fsmBill_3rd_Party Then
            .WriteLine "^FO490,228^AdN,0,0^FWN^FH^FDAccount: T " & objPackage.Recipient.AccountNo & "^FS"
        ElseIf objPackage.PaymentType = fsm_Collect Then
            .WriteLine "^FO490,228^AdN,0,0^FWN^FH^FDAccount: " & "Collect" & "^FS"
        Else
            .WriteLine "^FO490,228^AdN,0,0^FWN^FH^FDAccount: S " & objPackage.Sender.AccountNo & "^FS"
        End If
        .WriteLine "^FO10,324^A0N,20,18^FWN^FH^FDTO^FS"
        .WriteLine "^FO520,318^AdN,0,0^FWN^FH^FD" & objPackage.Recipient.Phone & "^FS"
        .WriteLine "^FO43,320^A0N,25,27^FWN^FH^FD" & objPackage.Recipient.Contact & "^FS"
        .WriteLine "^FO43,355^A0N,25,27^FWN^FH^FD" & objPackage.Recipient.Company & "^FS"
        .WriteLine "^FO43,390^A0N,25,27^FWN^FH^FD" & objPackage.Recipient.Address1 & "^FS"
        .WriteLine "^FO43,425^A0N,25,27^FWN^FH^FD" & objPackage.Recipient.Address2 & "^FS"
        .WriteLine "^FO43,458^A0N,30,30^FWN^FH^FD" & objPackage.Recipient.City & ", " & objPackage.Recipient.State & " " & objPackage.Recipient.Zip & "^FS"
        .WriteLine "^FO16,545^A0N,15,15^FWN^FH^FDREF: " & objPackage.CustomerReference & "^FS"
        .WriteLine "^FO10,714^A0N,20,18^FWN^FH^FDError1:" & strErrorMessage & "^FS"
        .WriteLine "^FO10,744^A0N,20,18^FWN^FH^FDError2:" & strErrorMessage & "^FS"
        .WriteLine "^FO100,764^A0N,20,18^FWN^FH^FD^FS"
        .WriteLine "^FO100,784^A0N,20,18^FWN^FH^FD^FS"
        .WriteLine "^FO100,804^A0N,20,18^FWN^FH^FD^FS"
        ' .WriteLine "^FO255,864^A0N,20,18^FWN^FH^FD FSMTRANSIN^FS"
        .WriteLine "^FO125,580^A0N,75,90^FWN^FH^FDDO NOT SHIP^FS"
        .WriteLine "^FO10,684^A0N,20,18^FWN^FH^FDError Detected During Processing^FS"
        .WriteLine "^FO35,864^A0N,20,18^FWN^FH^FDTransaction ID:" & objPackage.Invoice & "^FS"
        .WriteLine "^FO670,430^GB105,10,10^FS"
        .WriteLine "^FO670,440^GB10,112,10^FS"
        .WriteLine "^FO765,440^GB10,112,10^FS"
        .WriteLine "^FO670,552^GB105,10,10^FS"
        .WriteLine "^FO650,350^A0N,50,55^FWN^FH^FDFedEx^FS"
        .WriteLine "^FO715,393^AdN,0,0^FWN^FH^FD^FS"
        .WriteLine "^FO690,448^A0N,130,130^FWN^FH^FDE^FS"
        ' .WriteLine "^FO783,480^A0N,15,15^FWB^FH^FDJ092009113006^FS"
        .WriteLine "^FO490,188^AdN,0,0^FWN^FH^FDActual Wgt: " & objPackage.Weight & " ^FS"
        .WriteLine "^FO550,467^A0N,35,45^FWN^FH^FD(" & objPackage.Recipient.Country & ")^FS"
        .WriteLine "^PQ1"
        .WriteLine "^XZ"
          
        .Close
    End With
    Exit Sub
Handler:
    MsgBox Err.Description & vbCrLf & Err.Number, vbSystemModal, "modLabel8.ZplErrorLabel"

End Sub
'


Public Sub PrintMessageLabel(ByVal objPackage As Package, ByVal strErrorMessage As String)
    
    Dim strBufferFile As String
    Dim objFSO As FileSystemObject
    Set objFSO = New FileSystemObject
        
    If m_strUNC <> "" Then
        
        ' Logfile "modLabel8.PrintMessageLabel", "UNC " & m_strUNC
        
        If m_strPrinterType = "0" Then
              Call EplMessageLabel(objPackage, strErrorMessage)
        Else
              Call ZplMessageLabel(objPackage, strErrorMessage)
        End If
        
        With objFSO
            If UCase(Left(m_strUNC, 3)) = "C:\" Then
                m_lngBufferFile = m_lngBufferFile + 1
                .CopyFile m_strLabelTempFolder & m_strBufferFile, m_strUNC & "\Label_" & Format(Now, "HHnnss") & m_lngBufferFile & ".txt"
            Else
                .CopyFile m_strLabelTempFolder & m_strBufferFile, m_strUNC
            End If
            ' Logfile "modLabel8.PrintLabel", "Delete file " & m_strLabelTempFolder & m_strBufferFile
            .DeleteFile m_strLabelTempFolder & m_strBufferFile
        End With
    End If
    
Release:
    Set objFSO = Nothing
    Exit Sub
    
EH:
    MsgBox Err.Description & vbCrLf & Err.Number, vbSystemModal, "modLabel8.PrintMessageLabel"
    Resume Release
    If False Then
        Resume
    End If

End Sub
'



Private Sub EplMessageLabel(ByVal objPackage As Package, ByVal strErrorMessage As String)

End Sub
'

Private Sub ZplMessageLabel(ByVal objPackage As Package, ByVal strErrorMessage As String)
    
    On Local Error GoTo Handler
    
    Dim objFSO As FileSystemObject
    Dim objfile As File
    Dim strMiscellaneousPaymentType As String
    Dim strRecord As String
    Dim strFilename As String
    
    Set objFSO = New FileSystemObject
    If objFSO.FileExists(m_strLabelTempFolder & m_strBufferFile) Then
        objFSO.DeleteFile m_strLabelTempFolder & m_strBufferFile, True
    End If
    
    With objFSO.CreateTextFile(m_strLabelTempFolder & m_strBufferFile, True)
            
        .WriteLine "^XA^CF,0,0,0^PR12^MD30^PW800^POI^CI13^LH0,20"
        .WriteLine "^FO10,308^GB790,2,2^FS"
        .WriteLine "^FO10,565^GB790,2,2^FS"
        .WriteLine "^FO477,162^GB2,146,2^FS"
        .WriteLine "^FO43,320^A0N,25,27^FWN^FH^FD" & Mid(strErrorMessage, 1, 30) & "^FS"
        .WriteLine "^FO43,355^A0N,25,27^FWN^FH^FD" & Mid(strErrorMessage, 31, 30) & "^FS"
        .WriteLine "^FO43,390^A0N,25,27^FWN^FH^FD" & Mid(strErrorMessage, 61, 30) & "^FS"
        .WriteLine "^FO43,425^A0N,25,27^FWN^FH^FD" & Mid(strErrorMessage, 91, 30) & "^FS"
        .WriteLine "^FO43,458^A0N,30,30^FWN^FH^FD" & Mid(strErrorMessage, 121, 30) & "^FS"
        .WriteLine "^FO100,764^A0N,20,18^FWN^FH^FD^FS"
        .WriteLine "^FO100,784^A0N,20,18^FWN^FH^FD^FS"
        .WriteLine "^FO100,804^A0N,20,18^FWN^FH^FD^FS"
        ' .WriteLine "^FO255,864^A0N,20,18^FWN^FH^FD FSMTRANSIN^FS"
        .WriteLine "^FO670,430^GB105,10,10^FS"
        .WriteLine "^FO670,440^GB10,112,10^FS"
        .WriteLine "^FO765,440^GB10,112,10^FS"
        .WriteLine "^FO670,552^GB105,10,10^FS"
        .WriteLine "^FO650,350^A0N,50,55^FWN^FH^FDFedEx^FS"
        .WriteLine "^FO715,393^AdN,0,0^FWN^FH^FD^FS"
        .WriteLine "^FO690,448^A0N,130,130^FWN^FH^FDE^FS"
        .WriteLine "^PQ1"
        .WriteLine "^XZ"
          
        .Close
    End With
    Exit Sub
Handler:
    MsgBox Err.Description & vbCrLf & Err.Number, vbSystemModal, "modLabel8.ZplMessageLabel"

End Sub
'


